diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /app/policies/concerns | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/policies/concerns')
-rw-r--r-- | app/policies/concerns/policy_actor.rb | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/app/policies/concerns/policy_actor.rb b/app/policies/concerns/policy_actor.rb index 406677d7b56..f910e04d015 100644 --- a/app/policies/concerns/policy_actor.rb +++ b/app/policies/concerns/policy_actor.rb @@ -1,8 +1,15 @@ # frozen_string_literal: true -# Include this module if we want to pass something else than the user to -# check policies. This defines several methods which the policy checker -# would call and check. +# Include this module to have an object respond to user messages without being +# a user. +# +# Use Case 1: +# Pass something else than the user to check policies. This defines several +# methods which the policy checker would call and check. +# +# Use Case 2: +# Access the API with non-user object such as deploy tokens. This defines +# several methods which the API auth flow would call. module PolicyActor extend ActiveSupport::Concern @@ -37,6 +44,30 @@ module PolicyActor def alert_bot? false end + + def deactivated? + false + end + + def confirmation_required_on_sign_in? + false + end + + def can?(action, subject = :global) + Ability.allowed?(self, action, subject) + end + + def preferred_language + nil + end + + def requires_ldap_check? + false + end + + def try_obtain_ldap_lease + nil + end end PolicyActor.prepend_if_ee('EE::PolicyActor') |