<< Click to Display Table of Contents >> NShape Programmer Tasks
|
By default, the RoleBasedSecurityManager comes with several predefined settings, see section "Predefined Permission Sets" of the RoleBasedSecurityManager reference.
1. | If you want to override the default settings, clear all settings: |
RoleBasedSecurityManager securityManager = new RoleBasedSecurityManager(); |
2. | Now that all features are blocked for all users, you can start enabling access to certain users. Start with enabling full access to the administrator user: |
// Grant full access to Administrator user |
3. | Next, enable read-only access for Guest users. SecurityAccess.View means that properties of security aware objects are not hidden even if the user is not allowed to modify it. If a permission is not granted for view access, properties that require this permission will not show in the property presenter. |
// Guest User: View Only |
4. | And last but not least, set permissions for an operator user. Operator user will have the permission to access all view all and modify some in this example. |
// These objects can be inserted/deleted and modified but not styled. // Operator User |
5. | Finally, set the current user role. In this example, the current user will be hard coded in order to keep it simple: |
// Set current user |