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());