Module: Authorule::Rule
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/authorule/rule.rb
Overview
A permission rule. Each rule allows or denies the permission holder one permission.
Usage
Create a model class, and include this mixin into it, e.g.
class PermissionRule < ActiveRecord::Base
include Authorule::Rule
belongs_to :user
end
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#key ⇒ String
readonly
A unique key identifying this rule.
Instance Method Summary collapse
-
#to_display ⇒ Object
Misc.
Instance Attribute Details
#key ⇒ String (readonly)
Returns A unique key identifying this rule.
98 99 100 101 102 103 104 |
# File 'lib/authorule/rule.rb', line 98 def key if kind == 'all' 'all' else [ kind, name, action ].compact.join(':') end end |
Instance Method Details
#to_display ⇒ Object
Misc
109 110 111 |
# File 'lib/authorule/rule.rb', line 109 def to_display key end |