Module: CanHaz::ClassMethods

Defined in:
lib/rails-canhaz/model_extensions.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_canhaz_objectObject

Marks the current model as a canhaz object for authorizations



18
19
20
21
22
# File 'lib/rails-canhaz/model_extensions.rb', line 18

def acts_as_canhaz_object
  include CanHaz::ModelExtensions::Object
  extend CanHaz::ModelExtensions::Object::ClassMethods
  before_destroy :not_accessible # Removes permission before deleting the object
end

#acts_as_canhaz_subjectObject

Marks the current model as a canhaz subject for authorizations



27
28
29
30
31
# File 'lib/rails-canhaz/model_extensions.rb', line 27

def acts_as_canhaz_subject
  include CanHaz::ModelExtensions::Subject
  extend CanHaz::ModelExtensions::Subject::ClassMethods
  before_destroy :can_do_nothing # Removes permission before deleting the subject
end