Module: Walruz::Subject::ClassMethods
- Defined in:
- lib/walruz/subject.rb
Instance Method Summary collapse
-
#check_authorizations(policy_map) ⇒ Object
Stablishes the actions that can be made with a subject.
Instance Method Details
#check_authorizations(policy_map) ⇒ Object
Stablishes the actions that can be made with a subject. You may specify as many actions as you like, and also you may have a default policy, that will get executed if a specified flag doesn’t exist. You just have to pass the action :default, or the policy class only.
Once you stablish the authorizations policies on a subject, you can check if an actor is able to interact with it via the Walruz::Actor methods
79 80 81 82 83 84 85 86 |
# File 'lib/walruz/subject.rb', line 79 def (policy_map) case policy_map when Hash self._walruz_policies = policy_map else self._walruz_policies = { :default => policy_map } end end |