AccessControl: Replace IsEnterprise checks with license checks (#49572)

This commit is contained in:
Karl Persson
2022-05-25 20:40:41 +02:00
committed by GitHub
parent 2449f62dbe
commit 5caf97be40
11 changed files with 98 additions and 25 deletions
+2 -1
View File
@@ -112,7 +112,8 @@ func (ss *SQLStore) GetOrgUsers(ctx context.Context, query *models.GetOrgUsersQu
if query.User == nil {
ss.log.Warn("Query user not set for filtering.")
}
if ss.Cfg.IsEnterprise && !accesscontrol.IsDisabled(ss.Cfg) {
if !query.DontEnforceAccessControl && !accesscontrol.IsDisabled(ss.Cfg) {
acFilter, err := accesscontrol.Filter(query.User, "org_user.user_id", "users:id:", accesscontrol.ActionOrgUsersRead)
if err != nil {
return err