Show TOC Start of Content Area

Background documentation Role  Locate the document in its SAP Library structure

EP 5.0 has a basic role structure, with a unique name for every role. In EP 6.0, roles can be nested in folders and have a unique identifier. Most of the role API methods require the unique role ID as a handle or key to obtain the role information.

The getRoles() method of the IUser object gets a list of roles as iterator. The iterator contains the unique IDs of the roles associated with the user. In order to get the actual information about a specific role you have to use the role factory to get an instance of that role. The unique ID is passed to the getRole() method  of the role factory.

Example:

  response.write("<br>**** ROLE INFORMATION:");
  
if (rit.hasNext()) {
    IRoleFactory rfact = UMFactory.getRoleFactory();
    
while (rit.hasNext()) {
        String roleName = (String) rit.next();
        IRole role = 
null;
        
try {
            role = rfact.getRole(roleName);
            response.write(
"<br>Role:" + roleName  
            + 
"<br>Display Name:"    + role.getDisplayName()
            + 
"<br>ID: " + role.getUniqueID()
            + 
"<br>Uniquename: " + role.getUniqueName()
            + 
"<br>Description: " + role.getDescription());
        } 
catch (UMException e) {
        response.write(
"error: " + e.getLocalizedMessage());
        }
    }
  }

 

End of Content Area