|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.security.DelegatingUserManager
public class DelegatingUserManager
A UserManager
delegating to a set of user managers. The first user manager which does not
through an UnsupportedOperationException
will be used.
Field Summary |
---|
Fields inherited from interface info.magnolia.cms.security.UserManager |
---|
ANONYMOUS_USER, SYSTEM_PSWD, SYSTEM_USER |
Constructor Summary | |
---|---|
DelegatingUserManager(Map<String,UserManager> delegates)
|
Method Summary | |
---|---|
User |
addGroup(User user,
String groupName)
Adds user to a group. |
User |
addRole(User user,
String roleName)
Grants user role. |
User |
changePassword(User user,
String newPassword)
Sets a new password. |
User |
createUser(String name,
String pw)
Creates a user without security restrictions. |
User |
createUser(String path,
String name,
String pw)
Creates a user on given path. |
Map<String,ACL> |
getACLs(User user)
Returns all ACLs assigned to the given user. |
Collection<User> |
getAllUsers()
Get all users. |
User |
getAnonymousUser()
Get Anonymous user, this user must always exist in magnolia repository. |
int |
getLockTimePeriod()
Gets a time period for account lock. |
int |
getMaxFailedLoginAttempts()
Gets a number of failed attempts before locking account. |
User |
getSystemUser()
Get system user, this user must always exist in magnolia repository. |
User |
getUser(String name)
Find a specific user. |
User |
getUser(Subject subject)
Initialize new user using JAAS authenticated/authorized subject. |
User |
getUserById(String id)
Find a specific user. |
boolean |
hasAny(String principal,
String resourceName,
String resourceTypeName)
Checks whether principal belongs to the named resource. |
User |
removeGroup(User user,
String groupName)
Removes user from a group. |
User |
removeRole(User user,
String roleName)
Removes role from a user. |
void |
setLockTimePeriod(int lockTimePeriod)
Sets a time period for account lock. |
void |
setMaxFailedLoginAttempts(int maxFailedLoginAttempts)
Sets a number of failed attempts before locking account. |
User |
setProperty(User user,
String propertyName,
String propertyValue)
Sets given property for the user and returns updated user object with new value of the property. |
User |
setProperty(User user,
String propertyName,
javax.jcr.Value propertyValue)
Sets given property for the user and returns updated user object with new value of the property. |
void |
updateLastAccessTimestamp(User user)
Updates last access timestamp for the user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelegatingUserManager(Map<String,UserManager> delegates)
delegates
- Method Detail |
---|
public User createUser(String name, String pw) throws UnsupportedOperationException
UserManager
createUser
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User createUser(String path, String name, String pw) throws UnsupportedOperationException
UserManager
createUser
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User changePassword(User user, String newPassword) throws UnsupportedOperationException
UserManager
changePassword
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User getAnonymousUser()
UserManager
getAnonymousUser
in interface UserManager
public User getSystemUser()
UserManager
getSystemUser
in interface UserManager
public User getUser(String name) throws UnsupportedOperationException
UserManager
getUser
in interface UserManager
name
- the name of the user
UnsupportedOperationException
public User getUserById(String id) throws UnsupportedOperationException
UserManager
getUserById
in interface UserManager
id
- user identifier
UnsupportedOperationException
public User getUser(Subject subject) throws UnsupportedOperationException
UserManager
getUser
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic Collection<User> getAllUsers() throws UnsupportedOperationException
UserManager
getAllUsers
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic void updateLastAccessTimestamp(User user)
UserManager
updateLastAccessTimestamp
in interface UserManager
public boolean hasAny(String principal, String resourceName, String resourceTypeName)
UserManager
hasAny
in interface UserManager
resourceName
- either group or role nameresourceTypeName
- either group or role see
public Map<String,ACL> getACLs(User user)
UserManager
getACLs
in interface UserManager
public User addRole(User user, String roleName)
UserManager
addRole
in interface UserManager
public User addGroup(User user, String groupName)
UserManager
addGroup
in interface UserManager
public int getLockTimePeriod() throws UnsupportedOperationException
UserManager
getLockTimePeriod
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic int getMaxFailedLoginAttempts() throws UnsupportedOperationException
UserManager
getMaxFailedLoginAttempts
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic void setLockTimePeriod(int lockTimePeriod) throws UnsupportedOperationException
UserManager
setLockTimePeriod
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic void setMaxFailedLoginAttempts(int maxFailedLoginAttempts) throws UnsupportedOperationException
UserManager
setMaxFailedLoginAttempts
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User setProperty(User user, String propertyName, javax.jcr.Value propertyValue) throws UnsupportedOperationException
UserManager
setProperty
in interface UserManager
user
- User to be updated. If property doesn't exist yet, it will be created. If the value is null, property will be removed if existing.propertyName
- Name of the property.propertyValue
- Value of the property. Use org.apache.jackrabbit.value.ValueFactoryImpl to convert type to Value.
UnsupportedOperationException
public User setProperty(User user, String propertyName, String propertyValue)
UserManager
setProperty
in interface UserManager
public User removeGroup(User user, String groupName)
UserManager
removeGroup
in interface UserManager
public User removeRole(User user, String roleName)
UserManager
removeRole
in interface UserManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |