Class: ActiveSP::PermissionSet
- Inherits:
-
Object
- Object
- ActiveSP::PermissionSet
- Includes:
- Util
- Defined in:
- lib/activesp/permission_set.rb
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(scope) ⇒ PermissionSet
constructor
A new instance of PermissionSet.
-
#key ⇒ String
See Base#key.
-
#permissions ⇒ Array<Hash{:accessor, :permission => User, Group, Role, Integer}>
Returns the permissions in this permission set as an array of hashes with :accessor mapping to a user, group or role and :mask mapping to the permission as an integer.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(scope) ⇒ PermissionSet
Returns a new instance of PermissionSet.
35 36 37 |
# File 'lib/activesp/permission_set.rb', line 35 def initialize(scope) @scope = scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
32 33 34 |
# File 'lib/activesp/permission_set.rb', line 32 def scope @scope end |
Instance Method Details
#key ⇒ String
See Base#key
41 42 43 |
# File 'lib/activesp/permission_set.rb', line 41 def key encode_key("P", [@scope.key]) end |
#permissions ⇒ Array<Hash{:accessor, :permission => User, Group, Role, Integer}>
Returns the permissions in this permission set as an array of hashes with :accessor mapping to a user, group or role and :mask mapping to the permission as an integer
50 51 52 |
# File 'lib/activesp/permission_set.rb', line 50 def @scope.send(:permissions) end |
#to_s ⇒ Object Also known as: inspect
55 56 57 |
# File 'lib/activesp/permission_set.rb', line 55 def to_s "#<ActiveSP::PermissionSet scope=#{@scope}>" end |