diff options
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/global_policy.rb | 7 | ||||
-rw-r--r-- | app/policies/group_policy.rb | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb index 2bde7bcca08..9353b361c2a 100644 --- a/app/policies/global_policy.rb +++ b/app/policies/global_policy.rb @@ -17,6 +17,8 @@ class GlobalPolicy < BasePolicy condition(:private_instance_statistics, score: 0) { Gitlab::CurrentSettings.instance_statistics_visibility_private? } + condition(:project_bot, scope: :user) { @user&.project_bot? } + rule { admin | (~private_instance_statistics & ~anonymous) } .enable :read_instance_statistics @@ -51,6 +53,11 @@ class GlobalPolicy < BasePolicy prevent :use_slash_commands end + rule { project_bot }.policy do + prevent :log_in + prevent :receive_notifications + end + rule { deactivated }.policy do prevent :access_git prevent :access_api diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index a34217d90dd..728c4b76498 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -91,6 +91,7 @@ class GroupPolicy < BasePolicy end rule { reporter }.policy do + enable :reporter_access enable :read_container_image enable :download_wiki_code enable :admin_label |