[MM-53156] Remove Multi-Product architecture (#25669)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d3b799eaa5
Коммит
de3e5aab25
@@ -14,37 +14,11 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/shared/request"
|
||||
"github.com/mattermost/mattermost/server/v8/channels/product"
|
||||
)
|
||||
|
||||
const permissionsExportBatchSize = 100
|
||||
const systemSchemeName = "00000000-0000-0000-0000-000000000000" // Prevents collisions with user-created schemes.
|
||||
|
||||
// Ensure permissions service wrapper implements `product.PermissionService`
|
||||
var _ product.PermissionService = (*permissionsServiceWrapper)(nil)
|
||||
|
||||
// permissionsServiceWrapper provides an implementation of `product.PermissionService` for use by products.
|
||||
type permissionsServiceWrapper struct {
|
||||
app AppIface
|
||||
}
|
||||
|
||||
func (s *permissionsServiceWrapper) HasPermissionTo(userID string, permission *model.Permission) bool {
|
||||
return s.app.HasPermissionTo(userID, permission)
|
||||
}
|
||||
|
||||
func (s *permissionsServiceWrapper) HasPermissionToTeam(c request.CTX, userID string, teamID string, permission *model.Permission) bool {
|
||||
return s.app.HasPermissionToTeam(c, userID, teamID, permission)
|
||||
}
|
||||
|
||||
func (s *permissionsServiceWrapper) HasPermissionToChannel(c request.CTX, askingUserID string, channelID string, permission *model.Permission) bool {
|
||||
return s.app.HasPermissionToChannel(c, askingUserID, channelID, permission)
|
||||
}
|
||||
|
||||
func (s *permissionsServiceWrapper) RolesGrantPermission(roleNames []string, permissionId string) bool {
|
||||
return s.app.RolesGrantPermission(roleNames, permissionId)
|
||||
}
|
||||
|
||||
func (a *App) ResetPermissionsSystem() *model.AppError {
|
||||
// Reset all Teams to not have a scheme.
|
||||
if err := a.Srv().Store().Team().ResetAllTeamSchemes(); err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user