Package com.day.cq.security
Interface UserManager
-
public interface UserManagerDeprecated.cq 5.5 Use org.apache.jackrabbit.api.security.user.UserManager instead.UserManager allows access to Users and Groups. These are the Objects that act onResources. They are referred to by the common super-class 'Authorizable'.
Basic search and creation means are provided.
The UserManager for aSessioncan be accessed by use ofUserManagerFactoryNOTE: This does not go to the osg.services.UserManger, as it is not existing now...additionly to me its relation to Authentication outside Sling is not clear enough.- See Also:
Authorizable,UserManagerFactory
-
-
Field Summary
Fields Modifier and Type Field Description static intTYPE_GROUPDeprecated.static intTYPE_USERDeprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanautoSave(boolean enable)Deprecated.Changes the auto save behavior of thisUserManager.GroupcreateGroup(java.lang.String groupId, java.lang.String principalName)Deprecated.Creates a new Group for the given name and Principal-NameGroupcreateGroup(java.lang.String groupId, java.lang.String principalName, java.lang.String intermediatePath)Deprecated.Creates a new Group for the given name and Principal-NameUsercreateUser(java.lang.String userId, java.lang.String password, java.lang.String principalName)Deprecated.Creates a new User for given Id, password and PrincipalName.UsercreateUser(java.lang.String userId, java.lang.String password, java.lang.String principalName, java.lang.String intermediatePath)Deprecated.Creates a new User for given Id, password and PrincipalName.<AuthType extends Authorizable>
RangeIterator<AuthType>find(java.lang.String query, java.lang.Class<AuthType> type)Deprecated.Search forAuthorizablesthat contain the given Query.java.util.Iterator<Authorizable>find(java.lang.String propertyName, java.lang.String substring)Deprecated.Search for an Authorizable that contains the given query as a value of the given property.
The value doesn't have to match exactly.Authorizablefind(java.security.Principal principal)Deprecated.Searches for an Authorizable for the given Principal.AuthorizablefindByHome(java.lang.String homePath)Deprecated.Searches an Authorizable which has the given path as Path of it's Home Path property.Authorizableget(java.lang.String id)Deprecated.Accesses an Authorizable by itsID.java.util.Iterator<Group>getGroups()Deprecated.java.util.Iterator<User>getUsers()Deprecated.booleanhasAuthorizable(java.lang.String id)Deprecated.This method tests if the Manager has any Authorizable with this given ID.
If this method evaluates totruea call toget(id)has to return a non-nullAuthorizablebooleanisAutoSave()Deprecated.If any write operations executed through the User API are automatically persisted this method returnstrue.
-
-
-
Field Detail
-
TYPE_USER
static final int TYPE_USER
Deprecated.- See Also:
- Constant Field Values
-
TYPE_GROUP
static final int TYPE_GROUP
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
hasAuthorizable
boolean hasAuthorizable(java.lang.String id)
Deprecated.This method tests if the Manager has any Authorizable with this given ID.
If this method evaluates totruea call toget(id)has to return a non-nullAuthorizable- Parameters:
id- to be probed- Returns:
- true if an Authorizable with the given id exists
- See Also:
get(String)
-
get
Authorizable get(java.lang.String id) throws NoSuchAuthorizableException
Deprecated.Accesses an Authorizable by itsID. if an Authorizable exists a test withhasAuthorizable(id)has to betrue.- Parameters:
id- of the Authorizable requested- Returns:
- the requests Authorizable
- Throws:
NoSuchAuthorizableException- in case no Authorizable for that ID exists
-
find
Authorizable find(java.security.Principal principal)
Deprecated.Searches for an Authorizable for the given Principal.- Parameters:
principal- the Authorizable should contain- Returns:
- the Authorizable or
nullif none found - See Also:
Authorizable.getPrincipal()
-
find
java.util.Iterator<Authorizable> find(java.lang.String propertyName, java.lang.String substring)
Deprecated.Search for an Authorizable that contains the given query as a value of the given property.
The value doesn't have to match exactly. Property names of Property to be searched. The Authorizable defines default properties, implementations may extend these- Parameters:
propertyName- to be searched insubstring- to be found- Returns:
- Iterator of hits, empty if no Authorizable matches
-
getUsers
java.util.Iterator<User> getUsers()
Deprecated.- Returns:
- all Users this Manager knows. Should be used with care, may be time-consuming
-
getGroups
java.util.Iterator<Group> getGroups()
Deprecated.- Returns:
- all Groups this Manager knows.Should be used with care, may be time-consuming
-
createUser
User createUser(java.lang.String userId, java.lang.String password, java.lang.String principalName) throws AuthorizableExistsException, AccessDeniedException
Deprecated.Creates a new User for given Id, password and PrincipalName.- Parameters:
userId- Id for the Userpassword- plain password, implementations may encryptprincipalName- principalName to be used when authenticated- Returns:
- the newly created User
- Throws:
AuthorizableExistsException- in case the ID is already in useAccessDeniedException- in case the requesting session is not allowed to create a User
-
createUser
User createUser(java.lang.String userId, java.lang.String password, java.lang.String principalName, java.lang.String intermediatePath) throws AuthorizableExistsException, AccessDeniedException
Deprecated.Creates a new User for given Id, password and PrincipalName.- Parameters:
userId- Id for the Userpassword- plain password, implementations may encryptprincipalName- principalName to be used when authenticatedintermediatePath-- Returns:
- the newly created User
- Throws:
AuthorizableExistsException- in case the ID is already in useAccessDeniedException- in case the requesting session is not allowed to create a User
-
createGroup
Group createGroup(java.lang.String groupId, java.lang.String principalName) throws AuthorizableExistsException, AccessDeniedException
Deprecated.Creates a new Group for the given name and Principal-Name- Parameters:
groupId- to be assigned to the new GroupprincipalName- for the new Group- Returns:
- newly created Group
- Throws:
AuthorizableExistsException- if the id is already in useAccessDeniedException- in case the requesting session is not allowed to create a Group
-
createGroup
Group createGroup(java.lang.String groupId, java.lang.String principalName, java.lang.String intermediatePath) throws AuthorizableExistsException, AccessDeniedException
Deprecated.Creates a new Group for the given name and Principal-Name- Parameters:
groupId- to be assigned to the new GroupprincipalName- for the new GroupintermediatePath-- Returns:
- newly created Group
- Throws:
AuthorizableExistsException- if the id is already in useAccessDeniedException- in case the requesting session is not allowed to create a Group
-
find
<AuthType extends Authorizable> RangeIterator<AuthType> find(java.lang.String query, java.lang.Class<AuthType> type)
Deprecated.Search forAuthorizablesthat contain the given Query. Searches typical ID-Properties, likeauthorizable ID,principal name.- Parameters:
query- token to findtype- Class of Authorizable to take Authorizable to search for any kind- Returns:
- that match the query
-
findByHome
Authorizable findByHome(java.lang.String homePath)
Deprecated.Searches an Authorizable which has the given path as Path of it's Home Path property. Thus thatfindByHomepath(homePath).getHomePath().equals(homePath)- Parameters:
homePath- path of the Authorizable's Home- Returns:
- the Authorizable or
null - See Also:
Authorizable.getHomePath()
-
isAutoSave
boolean isAutoSave()
Deprecated.If any write operations executed through the User API are automatically persisted this method returnstrue. In this case there are no pending transient changes left and there is no need to explicitly callSession.save(). If this method returnsfalseany changes must be completed by an extra save call on theSessionassociated with thisUserManager.- Returns:
trueif changes are automatically persisted;falseif changes made through this API (including method calls onAuthorizableand subclasses are only transient and must be persisted usingSession.save().- See Also:
autoSave(boolean)
-
autoSave
boolean autoSave(boolean enable)
Deprecated.Changes the auto save behavior of thisUserManager.- Parameters:
enable- Iftruechanges made through this API will be automatically saved- Returns:
trueif the autoSave mode was successfully changed.
-
-