Sha256: af31e5611fb6a10b7de802d7873923b4371c8ba559aa9a60d662e0b337b26969
Contents?: true
Size: 797 Bytes
Versions: 3
Compression:
Stored size: 797 Bytes
Contents
# == Schema Information # # Table name: permissions # # id :integer not null, primary key # action :string(255) # subject_class :string(255) # subject_id :string(255) # role_id :integer # created_at :datetime not null # updated_at :datetime not null # sorter_id :integer default(0) # class Permission < ActiveRecord::Base attr_accessible :role_id, :action, :subject_class, :subject_id, :sorter_id belongs_to :role PossibleSubjectClasses = [":all"] + ActiveRecord::Base.descendants.map(&:name) PossibleActions = ["read", "not_read", "manage", "not_manage", "update", "not_update", "destroy", "not_destroy"] default_scope order("sorter_id ASC, id") scope :by_role, lambda{|rid| where(:role_id => rid)} end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rdcms-1.0.28 | app/models/permission.rb |
rdcms-1.0.27 | app/models/permission.rb |
rdcms-1.0.26 | app/models/permission.rb |