Sha256: 402323299afb904811cdfd72bb985a46d555347773e425f8b90cf0d337162e25

Contents?: true

Size: 525 Bytes

Versions: 2

Compression:

Stored size: 525 Bytes

Contents

class Cbac::KnownPermission < ActiveRecord::Base
  self.table_name = "cbac_known_permissions"
  attr_readonly :permission_type, :permission_number

  cattr_accessor :PERMISSION_TYPES
  @@PERMISSION_TYPES = {:context => 0, :generic => 1}

  def self.find_context_permissions(conditions = {})
    where(conditions.merge(:permission_type => @@PERMISSION_TYPES[:context])).all
  end

  def self.find_generic_permissions(conditions = {})
    where(conditions.merge(:permission_type => @@PERMISSION_TYPES[:generic])).all
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cbac-0.8.0 lib/cbac/known_permission.rb
cbac-0.7.0 lib/cbac/known_permission.rb