Error processing SSI file
LEADTOOLS JavaScript (Leadtools.Annotations.Core)

AnnGroupsRoles Object

Show in webframe
Members 
Provides support for user roles in the annotations framework.
Syntax
function Leadtools.Annotations.Core.AnnGroupsRoles() 
Remarks

AnnGroupsRoles supports adding roles for a multi-user application support in the annotations framework. This is accomplished by the following concepts:

The AnnotationsRolesDemo projects contains a of multi-user annotations application. Refer to the source code of the demo for a full example.

To create a multi-user application:

  1. Create an instance of AnnGroupsRoles

  2. Define the roles required by creating an instance of AnnRoles. AnnRoles contain common roles that can be used as is such as ViewAll, EditAll and FullControl to be able to view/edit and have full control over all annotation objects for all users. And View and Edit to be able to view and edit only the annotation objects created by the specified user.

  3. Define the groups required by the application. This is a list of names of the groups such as "Admin" and "Guest" and any other group defined by the application. Assign roles to each group by adding values to the GroupRoles dictionary.

  4. Define the users of the application. Each user must belong to a group, so add all the user names to the GroupUsers dictionary.

  5. Set the current logged in user to CurrentUser.

  6. Set the AnnGroupsRoles object created into the all the AnnContainer objects in the application.

When the application runs and the various annotations operations are invoked on this container, the system will map the CurrentUser to its group to deduce the roles. Then it will check if the group contains the correct role before allowing or denying the operation.

The annotation framework will accomplish this by calling the IsUserInRole method with the user name and an AnnOperationInfoEventArgs instance that contains default details of the operation (for instance, the user is deleting an object). The default mapping of the operation versus the role (deleting an object is an Edit operation) will be invoked and the method will return a boolean value to the caller annotation method to continue or abort the operation.

See Also

Reference

AnnGroupsRoles Members
Leadtools.Annotations.Core Namespace

Error processing SSI file