Module: Reactor::Permission::Base
- Defined in:
- lib/reactor/permission.rb
Instance Method Summary collapse
-
#edit!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#edit! and ensures that current user has required permissions to edit the object.
- #permission ⇒ Object
-
#release!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#release! and ensures that current user has required permissions to release the object.
-
#resolve_refs! ⇒ Object
Wraps around Reactor::Persistence::Base#resolve_refs! and ensures that current user has required permissions to call resolve refs on the object.
-
#revert!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#revert! and ensures that current user has required permissions to revert the object.
-
#save ⇒ Object
Wraps around ActiveRecord::Persistence#save and ensures that current user has required permissions to save the object.
-
#save! ⇒ Object
Wraps around ActiveRecord::Persistence#save! and ensures that current user has required permissions to save the object.
-
#take!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#take! and ensures that current user has required permissions to take the object.
Instance Method Details
#edit!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#edit! and ensures that current user has required permissions to edit the object
50 51 52 53 |
# File 'lib/reactor/permission.rb', line 50 def edit!(*args) (:edit) super end |
#permission ⇒ Object
19 20 21 |
# File 'lib/reactor/permission.rb', line 19 def @permission ||= PermissionProxy.new(self) end |
#release!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#release! and ensures that current user has required permissions to release the object
26 27 28 29 |
# File 'lib/reactor/permission.rb', line 26 def release!(*args) (:release) super end |
#resolve_refs! ⇒ Object
Wraps around Reactor::Persistence::Base#resolve_refs! and ensures that current user has required permissions to call resolve refs on the object
84 85 86 87 |
# File 'lib/reactor/permission.rb', line 84 def resolve_refs! (:write) super end |
#revert!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#revert! and ensures that current user has required permissions to revert the object
42 43 44 45 |
# File 'lib/reactor/permission.rb', line 42 def revert!(*args) (:revert) super end |
#save ⇒ Object
Wraps around ActiveRecord::Persistence#save and ensures that current user has required permissions to save the object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/reactor/permission.rb', line 58 def save if persisted? (:write) else (parent_obj_id) end super rescue Reactor::NotPermitted false end |
#save! ⇒ Object
Wraps around ActiveRecord::Persistence#save! and ensures that current user has required permissions to save the object
72 73 74 75 76 77 78 79 |
# File 'lib/reactor/permission.rb', line 72 def save! if persisted? (:write) else (parent_obj_id) end super end |
#take!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#take! and ensures that current user has required permissions to take the object
34 35 36 37 |
# File 'lib/reactor/permission.rb', line 34 def take!(*args) (:take) super end |