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
54 55 56 57 |
# File 'lib/reactor/permission.rb', line 54 def edit!(*args) (:edit) return super end |
#permission ⇒ Object
23 24 25 |
# File 'lib/reactor/permission.rb', line 23 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
30 31 32 33 |
# File 'lib/reactor/permission.rb', line 30 def release!(*args) (:release) return 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
88 89 90 91 |
# File 'lib/reactor/permission.rb', line 88 def resolve_refs! (:write) return super end |
#revert!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#revert! and ensures that current user has required permissions to revert the object
46 47 48 49 |
# File 'lib/reactor/permission.rb', line 46 def revert!(*args) (:revert) return super end |
#save ⇒ Object
Wraps around ActiveRecord::Persistence#save and ensures that current user has required permissions to save the object
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/reactor/permission.rb', line 62 def save if persisted? (:write) else (self.parent_obj_id) end return super rescue Reactor::NotPermitted return false end |
#save! ⇒ Object
Wraps around ActiveRecord::Persistence#save! and ensures that current user has required permissions to save the object
76 77 78 79 80 81 82 83 |
# File 'lib/reactor/permission.rb', line 76 def save! if persisted? (:write) else (self.parent_obj_id) end return super end |
#take!(*args) ⇒ Object
Wraps around Reactor::Persistence::Base#take! and ensures that current user has required permissions to take the object
38 39 40 41 |
# File 'lib/reactor/permission.rb', line 38 def take!(*args) (:take) return super end |