Class: ActiveSP::PermissionSet

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/activesp/permission_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#scopeObject (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

#keyString

See Base#key

Returns:

  • (String)


41
42
43
# File 'lib/activesp/permission_set.rb', line 41

def key
  encode_key("P", [@scope.key])
end

#permissionsArray<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

Examples:

set.permissions #=> [{:accessor=>#<ActiveSP::User login_name=SHAREPOINT\system>, :mask=>134287360}]

Returns:

  • (Array<Hash{:accessor, :permission => User, Group, Role, Integer}>)


50
51
52
# File 'lib/activesp/permission_set.rb', line 50

def permissions
  @scope.send(:permissions)
end

#to_sObject Also known as: inspect



55
56
57
# File 'lib/activesp/permission_set.rb', line 55

def to_s
  "#<ActiveSP::PermissionSet scope=#{@scope}>"
end