Module: Verikloak::Pundit::Delegations
- Defined in:
- lib/verikloak/pundit/delegations.rb
Overview
Shared role/permission delegations to expose consistent helpers.
Instance Method Summary collapse
-
#has_permission?(perm) ⇒ Boolean
Check whether the user has a mapped permission.
-
#has_role?(role) ⇒ Boolean
Check whether the user has a realm role.
-
#in_group?(group) ⇒ Boolean
Check whether the user belongs to a group (alias to role).
-
#resource_role?(client, role) ⇒ Boolean
Check whether the user has a role for a specific resource client.
Instance Method Details
#has_permission?(perm) ⇒ Boolean
Check whether the user has a mapped permission.
26 |
# File 'lib/verikloak/pundit/delegations.rb', line 26 def (perm) = user.(perm) # rubocop:disable Naming/PredicatePrefix |
#has_role?(role) ⇒ Boolean
Check whether the user has a realm role.
10 |
# File 'lib/verikloak/pundit/delegations.rb', line 10 def has_role?(role) = user.has_role?(role) # rubocop:disable Naming/PredicatePrefix |
#in_group?(group) ⇒ Boolean
Check whether the user belongs to a group (alias to role).
15 |
# File 'lib/verikloak/pundit/delegations.rb', line 15 def in_group?(group) = user.in_group?(group) |
#resource_role?(client, role) ⇒ Boolean
Check whether the user has a role for a specific resource client.
21 |
# File 'lib/verikloak/pundit/delegations.rb', line 21 def resource_role?(client, role) = user.resource_role?(client, role) |