Module: Recurso::Identity
- Defined in:
- lib/recurso/concerns/identity.rb
Class Method Summary collapse
Instance Method Summary collapse
- #policy(resource = self) ⇒ Object
- #policy_class ⇒ Object
- #resources_with_permission(relation_name, action: :view, all_columns: true, include_actions: []) ⇒ Object
Class Method Details
Instance Method Details
#policy(resource = self) ⇒ Object
10 11 12 |
# File 'lib/recurso/concerns/identity.rb', line 10 def policy(resource = self) (resource&.policy_class || Recurso::NilClassPolicy).new(self, resource) end |
#policy_class ⇒ Object
23 24 25 |
# File 'lib/recurso/concerns/identity.rb', line 23 def policy_class Recurso::BasePolicy end |
#resources_with_permission(relation_name, action: :view, all_columns: true, include_actions: []) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/recurso/concerns/identity.rb', line 14 def (relation_name, action: :view, all_columns: true, include_actions: []) policy(Recurso::Global.instance).( relation_name, action: action, all_columns: all_columns, include_actions: include_actions ) end |