Module: PolicyActor

Extended by:
ActiveSupport::Concern
Included in:
DeployToken
Defined in:
app/policies/concerns/policy_actor.rb

Overview

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.

Instance Method Summary collapse

Instance Method Details

#access_locked?Boolean

Returns:

  • (Boolean)

32
33
34
# File 'app/policies/concerns/policy_actor.rb', line 32

def access_locked?
  false
end

#admin?Boolean

Returns:

  • (Boolean)

20
21
22
# File 'app/policies/concerns/policy_actor.rb', line 20

def admin?
  false
end

#alert_bot?Boolean

Returns:

  • (Boolean)

44
45
46
# File 'app/policies/concerns/policy_actor.rb', line 44

def alert_bot?
  false
end

#blocked?Boolean

Returns:

  • (Boolean)

16
17
18
# File 'app/policies/concerns/policy_actor.rb', line 16

def blocked?
  false
end

#can?(action, subject = :global) ⇒ Boolean

Returns:

  • (Boolean)

60
61
62
# File 'app/policies/concerns/policy_actor.rb', line 60

def can?(action, subject = :global)
  Ability.allowed?(self, action, subject)
end

#can_create_groupObject


40
41
42
# File 'app/policies/concerns/policy_actor.rb', line 40

def can_create_group
  false
end

#confirmation_required_on_sign_in?Boolean

Returns:

  • (Boolean)

56
57
58
# File 'app/policies/concerns/policy_actor.rb', line 56

def confirmation_required_on_sign_in?
  false
end

#deactivated?Boolean

Returns:

  • (Boolean)

52
53
54
# File 'app/policies/concerns/policy_actor.rb', line 52

def deactivated?
  false
end

#external?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'app/policies/concerns/policy_actor.rb', line 24

def external?
  false
end

#internal?Boolean

Returns:

  • (Boolean)

28
29
30
# File 'app/policies/concerns/policy_actor.rb', line 28

def internal?
  false
end

#preferred_languageObject


64
65
66
# File 'app/policies/concerns/policy_actor.rb', line 64

def preferred_language
  nil
end

#required_terms_not_accepted?Boolean

Returns:

  • (Boolean)

36
37
38
# File 'app/policies/concerns/policy_actor.rb', line 36

def required_terms_not_accepted?
  false
end

#requires_ldap_check?Boolean

Returns:

  • (Boolean)

68
69
70
# File 'app/policies/concerns/policy_actor.rb', line 68

def requires_ldap_check?
  false
end

#support_bot?Boolean

Returns:

  • (Boolean)

48
49
50
# File 'app/policies/concerns/policy_actor.rb', line 48

def support_bot?
  false
end

#try_obtain_ldap_leaseObject


72
73
74
# File 'app/policies/concerns/policy_actor.rb', line 72

def try_obtain_ldap_lease
  nil
end