AuthorizationExample



Feature Overview

Once the user logs into Web NMS,  it is the task of Security Authorization service to take care of the access limits of the respective users. Using this service the NMS users are allowed to view and perform operations in the respective domain by setting permission levels.  Thus, authorization is the process which is responsible for validating an authenticated user's request and granting/denying him permission to perform the requested task.

For more details about Authorization in Web NMS, refer to the documentation in Developer Guide --> Security Services --> Authorization

 

Example Overview

Example name : AuthorizationExample.java
Location : <Web NMS Home>/examples/Security/authorization directory

This example class is written to make the user understand how to use the method "isAuthorized(java.lang.String userName,java.lang.String operationName, java.util.Properties viewProperties)".

This example will check for the access rights of the user. Thus, this example helps to check whether a user has permission for performing operations on a group of objects.


The interface used in this example is AuthorizationEngine API 

Method used in this example is :

Note : The source code will have comment statements in it which will explain to you the different segments of the program.

 

Integration with Web NMS

The steps given below will help you in integrating this example with Web NMS. If any of the steps given below are not followed properly, then the example might not function in a desired manner.

java  com.adventnet.nms.example.security.authorization.AuthorizationExample <username> <operation name>

 

Sample Output

On giving a username and operation name as arguments to this example program, the output of the program printed in your console, will be : "User <username> is Authorized to do the operation <operation name>" or "User <username> can't do the operation <operation name>"

 

De-referencing

After you have tried this example, to remove its association with Web NMS, you must remove the class file AuthorizationExample.class from <Web NMS Home>/classes/com/adventnet/nms/example/security/authorization directory.


Copyright © 1996-2002, AdventNet Inc. All Rights Reserved.