Running Business Processes and Composite Applications 10.5 | Running Business Processes and Composite Applications | Administering My webMethods Server | Working with the Common Directory Services API | CDS Code Examples | Create Static Role and Add User as a Member
 
Create Static Role and Add User as a Member
IDirectorySession session =
DirectorySystemFactory.getDirectorySystem().createSession();
IDirectoryUser user = (IDirectoryUser) session.lookupPrincipalByName
    ("user1", IDirectoryPrincipal.TYPE_USER);
IDirectoryRole role = session.createRole(IDirectoryRole.STATIC_ROLE_TYPE,
    "roleName", Collections.EMPTY_MAP);
session.addPrincipalToRole(user.getID(), role.getID());

Copyright © 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.