Class: DeadSimpleAuthorization::Policy::Base
- Inherits:
-
Object
- Object
- DeadSimpleAuthorization::Policy::Base
- Defined in:
- lib/dead_simple_authorization/policy.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(resource, user) ⇒ Base
constructor
The resource (e.g. a model) and user objects are available in all Policy objects that inherit from BasePolicy and can be used by authorize action methods.
Constructor Details
#initialize(resource, user) ⇒ Base
The resource (e.g. a model) and user objects are available in all Policy objects that inherit from BasePolicy and can be used by authorize action methods.
11 12 13 14 |
# File 'lib/dead_simple_authorization/policy.rb', line 11 def initialize(resource, user) @user = user @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'lib/dead_simple_authorization/policy.rb', line 4 def resource @resource end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'lib/dead_simple_authorization/policy.rb', line 5 def user @user end |