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 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 :
isAuthorized(java.lang.String userName,java.lang.String operationName,java.util.Properties viewProperties)
This method is used to perform access verification for a particular user who wants to perform a particular operation, on an object with the specified properties.
Parameters: userName - The name of the user who is performing the operation.
operationName - The name of the operation that the user performs.
viewProperties - The set of properties(property Name, property Value pair) of the object on which the operation is to be performed.
Returns: A boolean value true if the operation for the specified user and specified properties is authorized. Otherwise returns false.
Throws: AuthorizationException - if there is any exception or error during database operation java.rmi.RemoteException - In case of RMI.
Note : The source code will have comment statements in it which will explain to you the different segments of the program.
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.
<username> <operation name>
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>"
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.