diff options
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 |