TOPICA Basic Class PermissionCollection |
[This is preliminary documentation and is subject to change.]
The PermissionCollection class is a collection of
Permission
objects.
PermissionCollection propertiesProperty | Type | Description |
---|
ToString |
String
|
Returns a string representation for debugging etc.
|
ToLines |
String
|
Returns a string representation of the Permission objects in the collection,
each line containing the string representation of one Permission object.
The lines are separated by Newline.
|
Count | Integer | Number of objects in the collection |
PermissionCollection indexingIndex type | Description |
---|
Integer
|
Zero-based:
EmployeeUser.Permissions[0] returns the first
Permission related to the
Employee user.
|
String
|
Look-up by permission name.
May be used to test whether the logged in
Employee user has a
permission with a given name.
Example | Description |
---|
EmployeeUser.Permissions["Everything"] |
Returns the "Everything" Permission,
if the logged in
Employee user has this
Permission
- null if the user does not have this
Permission.
| IsNotNull(EmployeeUser.Permissions["Everything"]) |
Returns true iff the
Employee user has the "Everything"
Permission -
in other words, iff the user is system administrator.
Note |
---|
The above example is the CORRECT way to check, whether the user is system adminstrator
(has access to everything).
Checking for profile "SystemAdministrator" is the WRONG way.
See ProfileCollection.
Summary: to check whether user is system adminstrator,
check for Permission "Everything",
NOT Profile "SystemAdminstrator"!
Sorry for the less that intuitive names...
|
|
|