Module: Canhaz::Mongoid::ModelExtensions::ClassMethods
- Defined in:
- lib/mongoid-canhaz/model_extentions.rb
Instance Method Summary collapse
-
#acts_as_canhaz_object ⇒ Object
Marks the current model as a canhaz subject for authorizations.
-
#acts_as_canhaz_subject ⇒ Object
Marks the current model as a canhaz object for authorizations.
Instance Method Details
#acts_as_canhaz_object ⇒ Object
Marks the current model as a canhaz subject for authorizations
35 36 37 38 39 40 |
# File 'lib/mongoid-canhaz/model_extentions.rb', line 35 def acts_as_canhaz_object include Canhaz::Mongoid::ObjectExtensions class_eval do has_many :permissions_subjects, :class_name => 'Canhaz::Mongoid::Permission', :inverse_of => 'cobject' end end |
#acts_as_canhaz_subject ⇒ Object
Marks the current model as a canhaz object for authorizations
27 28 29 30 |
# File 'lib/mongoid-canhaz/model_extentions.rb', line 27 def acts_as_canhaz_subject include Canhaz::Mongoid::SubjectExtensions has_many :permissions, :class_name => 'Canhaz::Mongoid::Permission', :inverse_of => 'csubject' end |