Show TOC Start of Content Area

Background documentation Role  Locate the document in its SAP Library structure

Every role has a unique name and 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. To get the actual information about a specific role you must 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 roleID = (String) rit.next();
        IRole role = 
null;
        
try {
            role = rfact.getRole(roleID);
            response.write(
"<br>Role:" + roleID  
            + 
"<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