summaryrefslogtreecommitdiffstats
path: root/utils/authorization.go
diff options
context:
space:
mode:
authorDerrick Anderson <derrick@andersonwebstudio.com>2018-02-12 16:13:01 -0500
committerDerrick Anderson <derrick@andersonwebstudio.com>2018-02-12 16:13:01 -0500
commit32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c (patch)
tree5e1653318a6a14bcad80025793adab0f700deed9 /utils/authorization.go
parent62efb1df754bfe6b10a3c17ca6f89fd33b991f56 (diff)
parentc209e4457457edc042f063390c9a222a694f3a6d (diff)
downloadchat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.tar.gz
chat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.tar.bz2
chat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.zip
Merge branch 'release-4.7-revertmaster' into release-4.7
Diffstat (limited to 'utils/authorization.go')
-rw-r--r--utils/authorization.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/utils/authorization.go b/utils/authorization.go
index 42815b807..39a0d606c 100644
--- a/utils/authorization.go
+++ b/utils/authorization.go
@@ -7,7 +7,7 @@ import (
"github.com/mattermost/mattermost-server/model"
)
-func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*model.Role {
+func DefaultRolesBasedOnConfig(cfg *model.Config) map[string]*model.Role {
roles := make(map[string]*model.Role)
for id, role := range model.DefaultRoles {
copy := &model.Role{}
@@ -15,7 +15,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
roles[id] = copy
}
- if isLicensed {
+ if IsLicensed() {
switch *cfg.TeamSettings.RestrictPublicChannelCreation {
case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append(
@@ -35,7 +35,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
)
}
- if isLicensed {
+ if IsLicensed() {
switch *cfg.TeamSettings.RestrictPublicChannelManagement {
case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append(
@@ -64,7 +64,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
)
}
- if isLicensed {
+ if IsLicensed() {
switch *cfg.TeamSettings.RestrictPublicChannelDeletion {
case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append(
@@ -93,7 +93,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
)
}
- if isLicensed {
+ if IsLicensed() {
switch *cfg.TeamSettings.RestrictPrivateChannelCreation {
case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append(
@@ -113,7 +113,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
)
}
- if isLicensed {
+ if IsLicensed() {
switch *cfg.TeamSettings.RestrictPrivateChannelManagement {
case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append(
@@ -142,7 +142,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
)
}
- if isLicensed {
+ if IsLicensed() {
switch *cfg.TeamSettings.RestrictPrivateChannelDeletion {
case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append(
@@ -172,7 +172,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
}
// Restrict permissions for Private Channel Manage Members
- if isLicensed {
+ if IsLicensed() {
switch *cfg.TeamSettings.RestrictPrivateChannelManageMembers {
case model.PERMISSIONS_ALL:
roles[model.CHANNEL_USER_ROLE_ID].Permissions = append(
@@ -214,7 +214,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
}
// Grant permissions for inviting and adding users to a team.
- if isLicensed {
+ if IsLicensed() {
if *cfg.TeamSettings.RestrictTeamInvite == model.PERMISSIONS_TEAM_ADMIN {
roles[model.TEAM_ADMIN_ROLE_ID].Permissions = append(
roles[model.TEAM_ADMIN_ROLE_ID].Permissions,
@@ -236,7 +236,7 @@ func DefaultRolesBasedOnConfig(cfg *model.Config, isLicensed bool) map[string]*m
)
}
- if isLicensed {
+ if IsLicensed() {
switch *cfg.ServiceSettings.RestrictPostDelete {
case model.PERMISSIONS_DELETE_POST_ALL:
roles[model.CHANNEL_USER_ROLE_ID].Permissions = append(