Message Editing and Deleting permissions (#4692)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
8f0175e15c
Коммит
99cf08ac38
@@ -148,4 +148,26 @@ func SetDefaultRolesBasedOnConfig() {
|
||||
model.PERMISSION_INVITE_USER.Id,
|
||||
)
|
||||
}
|
||||
|
||||
switch *Cfg.ServiceSettings.RestrictPostDelete {
|
||||
case model.PERMISSIONS_DELETE_POST_ALL:
|
||||
model.ROLE_CHANNEL_USER.Permissions = append(
|
||||
model.ROLE_CHANNEL_USER.Permissions,
|
||||
model.PERMISSION_DELETE_POST.Id,
|
||||
)
|
||||
model.ROLE_TEAM_ADMIN.Permissions = append(
|
||||
model.ROLE_TEAM_ADMIN.Permissions,
|
||||
model.PERMISSION_DELETE_POST.Id,
|
||||
model.PERMISSION_DELETE_OTHERS_POSTS.Id,
|
||||
)
|
||||
break
|
||||
case model.PERMISSIONS_DELETE_POST_TEAM_ADMIN:
|
||||
model.ROLE_TEAM_ADMIN.Permissions = append(
|
||||
model.ROLE_TEAM_ADMIN.Permissions,
|
||||
model.PERMISSION_DELETE_POST.Id,
|
||||
model.PERMISSION_DELETE_OTHERS_POSTS.Id,
|
||||
)
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -267,6 +267,9 @@ func getClientConfig(c *model.Config) map[string]string {
|
||||
props["EnableTesting"] = strconv.FormatBool(c.ServiceSettings.EnableTesting)
|
||||
props["EnableDeveloper"] = strconv.FormatBool(*c.ServiceSettings.EnableDeveloper)
|
||||
props["EnableDiagnostics"] = strconv.FormatBool(*c.LogSettings.EnableDiagnostics)
|
||||
props["RestrictPostDelete"] = *c.ServiceSettings.RestrictPostDelete
|
||||
props["AllowEditPost"] = *c.ServiceSettings.AllowEditPost
|
||||
props["PostEditTimeLimit"] = fmt.Sprintf("%v", *c.ServiceSettings.PostEditTimeLimit)
|
||||
|
||||
props["SendEmailNotifications"] = strconv.FormatBool(c.EmailSettings.SendEmailNotifications)
|
||||
props["SendPushNotifications"] = strconv.FormatBool(*c.EmailSettings.SendPushNotifications)
|
||||
|
||||
@@ -82,6 +82,9 @@ func trackConfig() {
|
||||
"restrict_custom_emoji_creation": *Cfg.ServiceSettings.RestrictCustomEmojiCreation,
|
||||
"enable_testing": Cfg.ServiceSettings.EnableTesting,
|
||||
"enable_developer": *Cfg.ServiceSettings.EnableDeveloper,
|
||||
"restrict_post_delete": *Cfg.ServiceSettings.RestrictPostDelete,
|
||||
"allow_edit_post": *Cfg.ServiceSettings.AllowEditPost,
|
||||
"post_edit_time_limit": *Cfg.ServiceSettings.PostEditTimeLimit,
|
||||
})
|
||||
|
||||
SendDiagnostic(TRACK_CONFIG_TEAM, map[string]interface{}{
|
||||
|
||||
Ссылка в новой задаче
Block a user