Module: Zuul::ActiveRecord::Context::PermissionMethods
- Defined in:
- lib/zuul/active_record/context.rb
Instance Method Summary collapse
-
#allowed_to?(subject, permission) ⇒ Boolean
Checks whether the subject possesses the specified permission within the context of self.
- #destroy_zuul_permissions ⇒ Object
Instance Method Details
#allowed_to?(subject, permission) ⇒ Boolean
Checks whether the subject possesses the specified permission within the context of self
43 44 45 |
# File 'lib/zuul/active_record/context.rb', line 43 def allowed_to?(subject, ) subject.(, self) end |
#destroy_zuul_permissions ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/zuul/active_record/context.rb', line 47 def auth_scopes.each do |name,scope| scope..where(:context_type => self.class.name, :context_id => self.id).each(&:destroy) scope..where(:context_type => self.class.name, :context_id => self.id).each(&:destroy) scope..where(:context_type => self.class.name, :context_id => self.id).each(&:destroy) end end |