diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-22 18:12:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-22 18:12:49 +0300 |
commit | c60010859638f577dab891358e83945561b35ad2 (patch) | |
tree | 6badf09d24d14aa03bf265f4ba7dcc368ac9fa78 /app/policies/global_policy.rb | |
parent | 26fa51816ab94df9c2f3db8c93da4d57f7bd6fc4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies/global_policy.rb')
-rw-r--r-- | app/policies/global_policy.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb index 175f86c9673..85ddf61fbd4 100644 --- a/app/policies/global_policy.rb +++ b/app/policies/global_policy.rb @@ -15,6 +15,8 @@ class GlobalPolicy < BasePolicy @user&.required_terms_not_accepted? end + condition(:can_create_group_and_projects, scope: :user) { @user&.allow_user_to_create_group_and_project? } + condition(:password_expired, scope: :user) do @user&.password_expired_if_applicable? end @@ -90,6 +92,8 @@ class GlobalPolicy < BasePolicy enable :create_group end + rule { ~can_create_group_and_projects }.prevent :create_group + rule { can_create_organization }.policy do enable :create_organization end |