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

Version Path
spree_admin_roles_and_access-1.3.0 app/models/spree/permission.rb
spree_admin_roles_and_access-1.2.1 app/models/spree/permission.rb
spree_admin_roles_and_access-1.2.0 app/models/spree/permission.rb
spree_admin_roles_and_access-1.1.0 app/models/spree/permission.rb