Class: ActsPermissive::Permission

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/acts_permissive/permission.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.bit_for(permission) ⇒ Object



18
19
20
# File 'lib/acts_permissive/permission.rb', line 18

def bit_for permission
  PermissionMap.hash[permission.to_s.downcase.to_sym] || 0
end

Instance Method Details

#reset!Object



23
24
25
26
# File 'lib/acts_permissive/permission.rb', line 23

def reset!
  self.mask = 0
  save!
end