Sha256: 6773de48f4e678b52fef540a97657519accedcee96cdf990701b439be662485c
Contents?: true
Size: 441 Bytes
Versions: 4
Compression:
Stored size: 441 Bytes
Contents
module Spree class Permission < ActiveRecord::Base include Permissions default_scope { order(:priority) } has_and_belongs_to_many :roles, :join_table => 'spree_roles_permissions', :class_name => 'Spree::Role' validates :title, :presence => true, :uniqueness => true scope :visible, lambda { where(:visible => true) } def ability(current_ability, user) send(title, current_ability, user) end end end
Version data entries
4 entries across 4 versions & 1 rubygems