Sha256: 81b013fe53db3d52db13ac209a70403e51a9f07966dd8b8ab93d1d17e09f221d

Contents?: true

Size: 370 Bytes

Versions: 1

Compression:

Stored size: 370 Bytes

Contents

module AssetHostCore
  class Permission < ActiveRecord::Base
    ABILITIES = [
      :read,
      :write
    ]

    attr_accessible :resource, :ability

    has_many :api_user_permissions
    has_many :api_users, through: :api_user_permissions

    validates :resource, :ability, presence: true

    def to_s
      "[#{self.resource}] #{self.ability}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asset_host_core-2.0.0.beta app/models/asset_host_core/permission.rb