Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-05-26 14:03:47 +03:00
коммит произвёл GitHub
родитель 0dd1969bd5
Коммит 9985e22dab
3 изменённых файлов: 20 добавлений и 7 удалений

Просмотреть файл

@@ -219,6 +219,10 @@ func NewChannels(s *Server, services map[ServiceKey]interface{}) (*Channels, err
app: &App{ch: ch},
}
services[PermissionsKey] = &permissionsServiceWrapper{
app: &App{ch: ch},
}
return ch, nil
}

Просмотреть файл

@@ -19,6 +19,14 @@ import (
const permissionsExportBatchSize = 100
const systemSchemeName = "00000000-0000-0000-0000-000000000000" // Prevents collisions with user-created schemes.
type permissionsServiceWrapper struct {
app AppIface
}
func (s *permissionsServiceWrapper) HasPermissionToTeam(userID string, teamID string, permission *model.Permission) bool {
return s.app.HasPermissionToTeam(userID, teamID, permission)
}
func (a *App) ResetPermissionsSystem() *model.AppError {
// Reset all Teams to not have a scheme.
if err := a.Srv().Store.Team().ResetAllTeamSchemes(); err != nil {

Просмотреть файл

@@ -86,13 +86,14 @@ var SentryDSN = "placeholder_sentry_dsn"
type ServiceKey string
const (
ChannelKey ServiceKey = "channel"
ConfigKey ServiceKey = "config"
LicenseKey ServiceKey = "license"
FilestoreKey ServiceKey = "filestore"
ClusterKey ServiceKey = "cluster"
PostKey ServiceKey = "post"
TeamKey ServiceKey = "team"
ChannelKey ServiceKey = "channel"
ConfigKey ServiceKey = "config"
LicenseKey ServiceKey = "license"
FilestoreKey ServiceKey = "filestore"
ClusterKey ServiceKey = "cluster"
PostKey ServiceKey = "post"
TeamKey ServiceKey = "team"
PermissionsKey ServiceKey = "permissions"
)
type Server struct {