Sha256: f563fa3d1c5c0ce610cc38d1fc898435cf34fad2505f5f958ca97db47b751a8a

Contents?: true

Size: 442 Bytes

Versions: 1

Compression:

Stored size: 442 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

1 entries across 1 versions & 1 rubygems

Version Path
spree_admin_roles_and_access-2.0.0 app/models/spree/permission.rb