Add Permissions for a New User |
Scroll |
The TheSecurity class allows to create a new ThePermissionList for a user for the loaded object. The user can but does not have to be an Thereforeā¢ user with an ID. Users not yet in Thereforeā¢ are automatically added to the system. AddUser returns the created ThePermissionList for the new user.
1 |
Connect to the Thereforeā¢ server (see "Server - Connect and Disconnect" for Details) |
2 |
Declare and initialize a new TheSecurity instance. |
3 |
Load permissions for an object. |
4 |
Get a list of Thereforeā¢ users from the server. |
5 |
Find the new user for who you want to add permissions. This user can but does not have to be an Thereforeā¢ user. |
6 |
Add the user to the security instance. Users not yet in Thereforeā¢ are automatically added to the system. AddUser returns the created ThePermissionList for the new user. |
7 |
Set permissions for the new user. Note: The code sample grants all permissions to the new user but feel free to grant or deny different permissions. See "Change Permissions" for alternative ways of setting permissions. |
8 |
Save the changes on the server. Note: If no permissions were granted or denied to the new user, the new users ThePermissionList will not be added to the system. |
Requirements and Assumptions: Category number 9 exists in your Thereforeā¢ system. User named "Test" is a valid Thereforeā¢ user. If these assumptions do not apply to your system or configuration please replace them with appropriate values when copying the code samples below. |