CDS API - Get User Roles  
 

 Post a new Code Sample   Modify this Code Sample

This sample Java code provides an example of how to get a list of My webMethods Server roles that a user is a member of by interacting with the Common Directory Services API.

Submitted by: Software AG, July 2011
Applicable Versions:  7.1 to 8.2.1


IDirectorySession s = DirectorySystemFactory.getDirectorySystem().createSession();
IDirectoryPrincipal user = s.lookupPrincipalByName("username", IDirectoryPrincipal.TYPE_USER);
List<IDirectoryRole> roles = s.getRoleMembership(user.getID());
DirectorySystemFactory.getDirectorySystem().destroySession(s);

Description :

A My webMethods user is a member of one or more roles. My webMethods Server enables you to obtain the roles that a user is a member of with the Common Directory Service (CDS) API.

For general information about the Common Directory Services API, see the wiki article Managing Users with the Common Directory Service API. To see the Javadocs for Common Directory Services API, go to http://documentation.softwareag.com/webmethods/wmsuites/wmsuite8-2_ga/My_webMethods/8-2-SP1_CAF_and_MWS_Java_API_Reference/index.html.


 


Disclaimer :

Utilities and samples shown here are not official parts of the Software AG products. These utilities and samples are not eligible for technical support through Software AG Customer Care. Software AG makes no guarantees pertaining to the functionality, scalability, robustness, or degree of testing of these utilities and samples. Customers are strongly advised to consider these utilities and samples as "working examples" from which they should build and test their own solutions

 
Search Community Websites
webMethods Products
Adapters
ApplinX and EntireX
BPM Suite
B2B Integration
Business Activity Monitoring
Business Events
Designer, Deployer and Installation
ESB & Integration
Master Data Management
Messaging
Mobile
MWS, CAF and Task Engine
Tamino
Terms of Use    Privacy Policy    Imprint    Copyright © 2012 Software AG    Contact Us