Sha256: c4c316f9badf9b156289d69fb7d32c789f74f1f103fc33ada2f315ea06685350

Contents?: true

Size: 746 Bytes

Versions: 1

Compression:

Stored size: 746 Bytes

Contents

module Alberich
  class DerivedPermission < ActiveRecord::Base
    attr_accessible :entity_id, :permission_id, :role_id, :permission_object
    attr_accessible :permission

    # the source permission for the denormalized object
    belongs_to :permission
    validates_presence_of :permission_id

    # this is the object used for permission checks
    belongs_to :permission_object,      :polymorphic => true

    belongs_to :role
    validates_presence_of :role_id

    # entity is copied from source permission
    belongs_to :entity
    validates_presence_of :entity_id

    validates_uniqueness_of :permission_id, :scope => [:permission_object_id,
                                                       :permission_object_type]


  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alberich-0.2.0 app/models/alberich/derived_permission.rb