com.sap.security.api

Interface IRole

All Superinterfaces:
IPrincipal, IPrincipalMaint, IPrincipalSet, Serializable

public interface IRole
extends IPrincipalSet

This interface provides read and write access to attributes and properties of instances of type IRole. IRole extends IPrincipalSet and defines additional role specific characteristics.

If you want to keep and persist an identifier as a reference to an instance of IRole you must use method IPrincipal.getUniqueID(). As this identifier contains internal information and is usually not readable, it should not be used in end user interfaces.

Use methods IPrincipal.getDisplayName() or getUniqueName() in order to display attributes with a nice name for user interfaces.

NOTE: As this interface�can be extended, this interface can be freely used, but must not be implemented.


Field Summary
static String VERSIONSTRING
           
 
Fields inherited from interface com.sap.security.api.IPrincipal
BYTE_TYPE, CREATED_BY, DATASOURCE, DEFAULT_NAMESPACE, DEFAULT_RELATION_NAMESPACE, DESCRIPTION, DISPLAYNAME, LAST_MODIFIED_BY, PRINCIPAL_CREATION_DATE, PRINCIPAL_MODIFY_DATE, PRINCIPAL_RELATION_MEMBER_ATTRIBUTE, PRINCIPAL_RELATION_PARENT_ATTRIBUTE, STRING_TYPE, TRANSIENT_NAMESPACE, UNIQUE_NAME
 
Method Summary
 boolean addGroupMember(String newMember)
          Adds the specified group member to this role.
 boolean addUserMember(String newMember)
          Adds the specified user member to this role.
 String getDescription()
          Returns the description of this principal.
 Iterator getGroupMembers(boolean getChildMembers)
          Returns IDs of group principals belonging to this role
 String getUniqueName()
          Get uniqueName of this IRole object.
 Iterator getUserMembers(boolean getChildMembers)
          Returns IDs of user principals belonging to this role
 boolean isGroupMember(String member, boolean checkChildren)
          Returns true if the passed principal is a member of this role.
 boolean isUserMember(String member, boolean checkChildren)
          Returns true if the passed principal of type user is assigned to this role.
 boolean removeGroupMember(String oldMember)
          Remove the specified group member from this role.
 boolean removeUserMember(String oldMember)
          Remove the specified user member from this role.
 boolean setDescription(String description)
          Sets the description of this principal.
 
Methods inherited from interface com.sap.security.api.IPrincipalSet
addMember, getMembers, isMember, removeMember
 
Methods inherited from interface com.sap.security.api.IPrincipalMaint
addAttributeValue, commit, isModified, removeAttributeValue, rollback, save, setAttribute, setBinaryAttribute, setDisplayName
 
Methods inherited from interface com.sap.security.api.IPrincipal
created, equals, getAttribute, getAttributeNames, getAttributeNamespaces, getAttributeType, getBinaryAttribute, getDisplayName, getMessages, getParents, getUniqueID, hashCode, isExistenceChecked, isMutable, lastModified, refresh
 

Field Detail

VERSIONSTRING

static final String VERSIONSTRING
See Also:
Constant Field Values
Method Detail

getUserMembers

Iterator getUserMembers(boolean getChildMembers)
Returns IDs of user principals belonging to this role

Parameters:
getChildMembers - This method does a recursive search if the parameter getChildMembers is set to true.
Returns:
iterator of Strings of uniqueIds of this role
Throws:
NoSuchPCDRoleException - if the role does not exist

getGroupMembers

Iterator getGroupMembers(boolean getChildMembers)
Returns IDs of group principals belonging to this role

Parameters:
getChildMembers - This method does a recursive search if parameter getChildMembers is set to true.
Returns:
iterator of Strings of uniqueIds of this role
Throws:
NoSuchPCDRoleException - if the role does not exist

isUserMember

boolean isUserMember(String member,
                     boolean checkChildren)
Returns true if the passed principal of type user is assigned to this role.

Parameters:
member - - uniqueId of the principal whose membership is to be checked.
checkChildren - this method does a recursive search if this parameter is set to true
Returns:
true if the principal is a member of this collection, false otherwise.

isGroupMember

boolean isGroupMember(String member,
                      boolean checkChildren)
Returns true if the passed principal is a member of this role.

Parameters:
member - - uniqueId of the principal whose membership is to be checked.
checkChildren - this method does a recursive search if this parameter is set to true If a group is member of a group which is assigned to this role, true is returned.
Returns:
true if the group is assigned to this role, false otherwise.

addUserMember

boolean addUserMember(String newMember)
                      throws UMException
Adds the specified user member to this role. These changes will only take effect if you commit these changes to the role data store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.

Parameters:
newMember - - the uniqueIdOfUser to add to this role.
Returns:
true if the member was successfully added, false otherwise
Throws:
UMException

addGroupMember

boolean addGroupMember(String newMember)
                       throws UMException
Adds the specified group member to this role. These changes will only take effect if you commit these changes to the role data store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.

Parameters:
newMember - - the uniqueIdOfGroup to add to this role.
Returns:
true if the group was successfully added, false otherwise
Throws:
UMException

removeUserMember

boolean removeUserMember(String oldMember)
                         throws UMException
Remove the specified user member from this role. These changes will only take effect if you commit these changes to the role data store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.

Parameters:
oldMember - - the uniqueIdOfUser to remove from this role.
Returns:
true if the user member was successfully removed, false otherwise
Throws:
UMException

removeGroupMember

boolean removeGroupMember(String oldMember)
                          throws UMException
Remove the specified group member from this role. These changes will only take effect if you commit these changes to the role data store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.

Parameters:
oldMember - - the uniqueIdOfGroup to remove from this collection.
Returns:
true if the group member was successfully removed, false otherwise
Throws:
UMException

getDescription

String getDescription()
Returns the description of this principal.

Returns:
String: the description of this principal null : if no description exists

setDescription

boolean setDescription(String description)
                       throws UMException
Sets the description of this principal.

Parameters:
description - String representing the description of a role
Throws:
UMException - if the description could not be set

getUniqueName

String getUniqueName()
Get uniqueName of this IRole object. A (usually) unique readable name of an instance of IRole.

Note: Depending on the persistence layer it is not guaranteed that this name is unique. The uniqueName may change over time. Thus, do not persist the uniqueName. Always use the unique identifier (UniqueID) of IPrincipal.getUniqueID() for this purpose.

Use the uniqueName for searching and displaying in user interfaces.

Returns:
uniqueName of object
Access Rights

This class can be accessed from:


SC DC
[sap.com] ENGINEAPI [sap.com] com.sap.security.api.sda
[sap.com] ENGFACADE [sap.com] tc/je/usermanagement/api
[sap.com] CORE-TOOLS [sap.com] com.sap.engine.client.lib


Copyright 2010 SAP AG Complete Copyright Notice