Class: DefaultArsecurityHandler
- Inherits:
-
ArsecurityHandler
- Object
- ArsecurityHandler
- DefaultArsecurityHandler
- Defined in:
- lib/arsecurity_default.rb
Class Method Summary collapse
-
.accept? ⇒ Boolean
for customize logic, such as for administrator.
- .get_conditions(invocation) ⇒ Object
-
.reject? ⇒ Boolean
for customize logic, such as for time restriction.
- .set_conditions(invocation, conditions) ⇒ Object
Methods inherited from ArsecurityHandler
Class Method Details
.accept? ⇒ Boolean
for customize logic, such as for administrator
26 27 28 |
# File 'lib/arsecurity_default.rb', line 26 def accept? false end |
.get_conditions(invocation) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/arsecurity_default.rb', line 33 def get_conditions(invocation) case invocation.method when *ArsecurityDefault::CLASS_READ_METHOD args = invocation.args || [] = args. invocation.args = args invocation. = conditions = [:conditions] when ArsecurityDefault::CLASS_DELETE_METHOD conditions = invocation.args[0] when ArsecurityDefault::CLASS_UPDATE_METHOD conditions = invocation.args[1] end conditions end |
.reject? ⇒ Boolean
for customize logic, such as for time restriction
30 31 32 |
# File 'lib/arsecurity_default.rb', line 30 def reject? false end |
.set_conditions(invocation, conditions) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/arsecurity_default.rb', line 49 def set_conditions(invocation, conditions) case invocation.method when *ArsecurityDefault::CLASS_READ_METHOD = invocation. [:conditions] = conditions when ArsecurityDefault::CLASS_DELETE_METHOD invocation.args[0] = conditions when ArsecurityDefault::CLASS_UPDATE_METHOD invocation.args[1] = conditions end end |