|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface provides read-access to the user's attributes, and offers
basic support for authorization checking. Implementations of this interface
must make sure that all get-methods with a return type of String,
e.g. getFax(), getCompanyId() etc. return null
if that attribute either does not exist or has a null
value in the user store. This does NOT apply to the generic
getAttribute...() methods.
If you want to keep and persist an identifier as a
reference to an instance of IUser 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.
| Field Summary | |
static int |
DEFAULT_ACCESSIBILITY_LEVEL
Constant used for user's default accessibility level |
static int |
SCREENREADER_ACCESSIBILITY_LEVEL
Constant used for user's screen reader support |
static java.lang.String |
VERSIONSTRING
|
| Fields inherited from interface com.sap.security.api.IPrincipal |
BYTE_TYPE, DEFAULT_NAMESPACE, DEFAULT_RELATION_NAMESPACE, DESCRIPTION, DISPLAYNAME, PRINCIPAL_CREATION_DATE, PRINCIPAL_MODIFY_DATE, PRINCIPAL_RELATION_MEMBER_ATTRIBUTE, PRINCIPAL_RELATION_PARENT_ATTRIBUTE, STRING_TYPE, TRANSIENT_NAMESPACE, UNIQUE_NAME |
| Method Summary | |
void |
checkPermission(java.security.Permission permission)
If the user has the specified permission, this method does nothing. |
int |
getAccessibilityLevel()
Gets the user's accessibilityLevel used for Screen Reader Support |
java.lang.String |
getCellPhone()
Gets the user's default cellphone number. |
java.lang.String |
getCity()
Gets the user's city. |
java.lang.String |
getCompany()
Gets the user's company. |
java.lang.String |
getCountry()
Gets the ISO-3166 two-letter uppercase code of the country where the user lives. |
java.lang.String |
getCurrency()
Gets the three letter uppercase code of the user's currency, e.g. |
java.lang.String |
getDepartment()
Gets the user's department. |
java.lang.String |
getEmail()
Gets the user's default email address. |
java.lang.String |
getFax()
Gets the user's default fax number. |
java.lang.String |
getFirstName()
Gets the user's first name. |
java.lang.String |
getJobTitle()
Gets the user's job title, e.g. |
java.lang.String |
getLastName()
Gets the user's last name. |
java.util.Locale |
getLocale()
Gets the user's Locale; this determines e.g. |
java.util.Iterator |
getParentGroups(boolean recursive)
Gets the list of (all) parent groups including parents, grandparents, ... |
java.util.Iterator |
getRoles(boolean recursive)
Gets the list of (all) assigned roles of this user including parent groups, grandparent groups,... |
java.lang.String |
getSalutation()
Gets the user's salutation, e.g. |
java.lang.String |
getState()
Gets the user's state or region. |
java.lang.String |
getStreet()
Gets the user's street. |
java.lang.String |
getTelephone()
Gets the user's default telephone number. |
java.util.TimeZone |
getTimeZone()
Gets the user's time zone. |
java.lang.String |
getTitle()
Gets the user's academic title or title of nobility |
java.lang.Object |
getTransientAttribute(java.lang.String namespace,
java.lang.String name)
Generic get method to access additional transient attributes. |
java.lang.String |
getUid()
Deprecated. new applications should use IPrincipal.getUniqueID(). |
java.lang.String |
getUniqueName()
Get uniqueName of this IUser object. |
IUserAccount[] |
getUserAccounts()
Returns an array of useraccount objects which are assigned to this user. |
java.util.Iterator |
getUserAccountUniqueIDs()
Returns an iterator of String objects which represent the uniqueIDs of assigned IUserAccount objects |
IUserFactory |
getUserFactory()
Gets the user factory which instantiated this user object. |
java.lang.String |
getZip()
Gets the zip code of the user's city. |
boolean |
hasPermission(java.security.Permission permission)
Returns true if the user has
the given permission. |
boolean |
isCompanyUser()
Checks if this user belongs to a company. |
boolean |
isMemberOfGroup(java.lang.String uniqueIdOfGroup,
boolean recursive)
Checks if the principal belongs to the passed uniqueIdOfGroup This method does a recursive search, so if this principal belongs to a group which is a member of this group, true is returned. |
boolean |
isMemberOfRole(java.lang.String uniqueIdOfRole,
boolean recursive)
Checks if the principal belongs to the passed roleId This method does a recursive search if parameter recursive
is set to true. |
boolean |
setTransientAttribute(java.lang.String namespace,
java.lang.String name,
java.lang.Object o)
Generic method to associate arbitrary data with a principal. |
| Methods inherited from interface java.security.Principal |
equals, getName, hashCode, toString |
| Methods inherited from interface com.sap.security.api.IPrincipal |
created, equals, getAttribute, getAttributeNames, getAttributeNamespaces, getAttributeType, getBinaryAttribute, getDisplayName, getParents, getUniqueID, hashCode, isExistenceChecked, isMutable, lastModified, refresh |
| Field Detail |
public static final java.lang.String VERSIONSTRING
public static final int DEFAULT_ACCESSIBILITY_LEVEL
public static final int SCREENREADER_ACCESSIBILITY_LEVEL
| Method Detail |
public java.lang.String getUid()
IPrincipal.getUniqueID().
public java.lang.String getJobTitle()
public java.lang.String getDepartment()
public java.lang.String getTitle()
public java.lang.String getSalutation()
public java.lang.String getFirstName()
public java.lang.String getLastName()
public java.lang.String getStreet()
public java.lang.String getCity()
public java.lang.String getZip()
public java.lang.String getState()
public java.lang.String getCountry()
getCountry() of the user's Locale, since expatriate users
may not have their Locale's country set to the country where they
actually reside.public java.util.Locale getLocale()
getCountry() instead of using the Locale's country.null in case no locale
is stored for this IUser object.public java.util.TimeZone getTimeZone()
null in case no
timezone is stored for this IUser object.
NOTE: Do not modify this TimeZone object. For performance reasons the TimeZone object is only created once when method getTimeZone() is called the first time. In case you modify this TimeZone object you may encounter inconsistencies because the user object has a different Timezone value set on the persistence layer.
public java.lang.String getCurrency()
public java.lang.String getTelephone()
public java.lang.String getCellPhone()
public java.lang.String getFax()
public java.lang.String getEmail()
public boolean isCompanyUser()
true if user belongs to companypublic java.lang.String getCompany()
public IUserFactory getUserFactory()
public boolean hasPermission(java.security.Permission permission)
true if the user has
the given permission.true if the user has
the given permission.
public void checkPermission(java.security.Permission permission)
throws java.security.AccessControlException
permission, this method does nothing. If not, it will
throw an AccessControlException, and possibly trigger
appropriate tracing action.AccessControlException - if the user doesn't have the specified
permission
public IUserAccount[] getUserAccounts()
throws UMException
public java.util.Iterator getUserAccountUniqueIDs()
throws UMException
public int getAccessibilityLevel()
DEFAULT_ACCESSIBILITY_LEVEL
Following constants can be returned:
DEFAULT_ACCESSIBILITY_LEVEL
SCREENREADER_ACCESSIBILITY_LEVELpublic java.util.Iterator getRoles(boolean recursive)
true
NOTE: This method may also return roles which are already deleted.recursive - if true returns all parent rolespublic java.util.Iterator getParentGroups(boolean recursive)
truerecursive - if true returns all parent groups
public boolean isMemberOfRole(java.lang.String uniqueIdOfRole,
boolean recursive)
recursive
is set to true. If this user belongs to a
group which is a member of a role, true is returned.uniqueIdOfRole - identifying the rolerecursive - if true checks also all parent groupstrue if this user is directly or indirectly (via role membership)
assigned.
public boolean isMemberOfGroup(java.lang.String uniqueIdOfGroup,
boolean recursive)
uniqueIdOfGroup - the ID of the collectionpublic java.lang.String getUniqueName()
IUser object.
A (usually) unique readable name of an instance of IUser.
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 of
IPrincipal.getUniqueID()
for this purpose.
Use the uniqueName for searching and displaying in user interfaces.
public java.lang.Object getTransientAttribute(java.lang.String namespace,
java.lang.String name)
null.
Note: the transient attributes are instance specific.
namespace - namespace the attribute is in (may be
null)name - name of the attributenull if
this namespace or attribute within this namespace does not exist
public boolean setTransientAttribute(java.lang.String namespace,
java.lang.String name,
java.lang.Object o)
true if values is
different from the attribute's previous values, false
otherwise.
These texts are tansient and will not be stored in the persistence.namespace - namespace of the attribute to set.name - name of the attributeo - value of the attribute
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||