public interface Authorizable
User
and
Group
. It provides access to the Principal
s associated
with an Authorizable
(see below) and allow to access and
modify additional properties such as e.g. full name, e-mail or address.
Please note the difference between Authorizable
and
Principal
:
An Authorizable
is repository object that is neither associated
with nor depending from a particular Session
and thus independent
of the login mechanisms creating Session
s.
On the other hand Principal
s are representations of user
identities. In other words: each Principal
within the set
associated with the Session's Subject upon login represents an identity for
that user. An the set of Principal
s may differ between different
login mechanisms.
Consequently an one-to-many relationship exists between Authorizable
and Principal (see also getPrincipal()
.
The interfaces derived from Authorizable are defined as follows:
Modifier and Type | Method and Description |
---|---|
@NotNull java.util.Iterator<Group> |
declaredMemberOf() |
@NotNull java.lang.String |
getID()
Return the implementation specific identifier for this
Authorizable . |
@NotNull java.lang.String |
getPath()
Returns a JCR path if this authorizable instance is associated with an
item that can be accessed by the editing
Session . |
@NotNull java.security.Principal |
getPrincipal() |
@Nullable Value[] |
getProperty(@NotNull java.lang.String relPath)
Returns the values for the properties with the specified name or
null . |
@NotNull java.util.Iterator<java.lang.String> |
getPropertyNames()
Returns the names of properties present with
this
Authorizable not taking possible relative paths into consideration. |
@NotNull java.util.Iterator<java.lang.String> |
getPropertyNames(@NotNull java.lang.String relPath)
Returns the names of properties present with
this
Authorizable at the specified relative path. |
boolean |
hasProperty(@NotNull java.lang.String relPath)
Tests if a the property with specified name exists.
|
boolean |
isGroup() |
@NotNull java.util.Iterator<Group> |
memberOf() |
void |
remove()
Removes this
Authorizable , if the session has sufficient
permissions. |
boolean |
removeProperty(@NotNull java.lang.String relPath)
Removes the property with the given name.
|
void |
setProperty(@NotNull java.lang.String relPath,
@Nullable Value value)
Set an arbitrary property to this
Authorizable . |
void |
setProperty(@NotNull java.lang.String relPath,
@Nullable Value[] value)
Set an arbitrary property to this
Authorizable . |
@NotNull @NotNull java.lang.String getID() throws RepositoryException
Authorizable
. It could e.g. be a UserID or simply the
principal name.Authorizable
.RepositoryException
- if an error occurs.boolean isGroup()
Group
@NotNull @NotNull java.security.Principal getPrincipal() throws RepositoryException
RepositoryException
- If an error occurs.@NotNull @NotNull java.util.Iterator<Group> declaredMemberOf() throws RepositoryException
Group
s, this Authorizable is declared member of.RepositoryException
- If an error occurs.@NotNull @NotNull java.util.Iterator<Group> memberOf() throws RepositoryException
Group
s, this Authorizable is member of included
indirect group membership.RepositoryException
- If an error occurs.void remove() throws RepositoryException
Authorizable
, if the session has sufficient
permissions. Note, that removing an Authorizable
even
if it listed as member of a Group or if still has members (this is
a Group itself).RepositoryException
- If an error occurred and the
Authorizable
could not be removed.@NotNull @NotNull java.util.Iterator<java.lang.String> getPropertyNames() throws RepositoryException
this
Authorizable not taking possible relative paths into consideration.
Same as getPropertyNames(String)
where the specified string
is ".".RepositoryException
- If an error occurs.where the specified relative path is simply an
name.
,
hasProperty(String)
@NotNull @NotNull java.util.Iterator<java.lang.String> getPropertyNames(@NotNull @NotNull java.lang.String relPath) throws RepositoryException
this
Authorizable at the specified relative path.relPath
- A relative path.RepositoryException
- If an error occurs.getProperty(String)
,
hasProperty(String)
boolean hasProperty(@NotNull @NotNull java.lang.String relPath) throws RepositoryException
relPath
- The relative path to the property to be tested.true
if a property with the given name exists.RepositoryException
- If an error occurs.getProperty(String)
void setProperty(@NotNull @NotNull java.lang.String relPath, @Nullable @Nullable Value value) throws RepositoryException
Authorizable
.relPath
- The relative path of the property to be added or modified.value
- The desired value.RepositoryException
- If the specified property could not be set.void setProperty(@NotNull @NotNull java.lang.String relPath, @Nullable @Nullable Value[] value) throws RepositoryException
Authorizable
.relPath
- The relative path of the property to be added or modified.value
- The desired property values.RepositoryException
- If the specified property could not be set.@Nullable @Nullable Value[] getProperty(@NotNull @NotNull java.lang.String relPath) throws RepositoryException
null
.relPath
- Relative path of the property to be retrieved.null
if no such property exists.RepositoryException
- If an error occurs.boolean removeProperty(@NotNull @NotNull java.lang.String relPath) throws RepositoryException
relPath
- Relative path (or name) of the property to be removed.RepositoryException
- If an error occurs.@NotNull @NotNull java.lang.String getPath() throws UnsupportedRepositoryOperationException, RepositoryException
Session
.
Throws UnsupportedRepositoryOperationException
if this
method is not supported or if there is no item associated with this
authorizable that is accessible by the editing Session
.
Throws RepositoryException
if another error occurs while
retrieving the path.
Item
that corresponds to this
Authorizable
.UnsupportedRepositoryOperationException
- If this method is not
supported or if there exists no accessible item associated with this
Authorizable
instance.RepositoryException
- If an error occurs while retrieving the
Item
path.Copyright © 2010 - 2020 Adobe. All Rights Reserved