public interface UserManager
Modifier and Type | Field and Description |
---|---|
static String |
ANONYMOUS_USER
Anonymous user name.
|
static String |
SYSTEM_PSWD
Magnolia system default password.
|
static String |
SYSTEM_USER
Magnolia system user name.
|
Modifier and Type | Method and Description |
---|---|
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) |
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)
Deprecated.
since 5.3.3 jaas login module should just request the user, not pass the subject around to the user manager
|
User |
getUserById(String id)
Find a specific user.
|
Collection<String> |
getUsersWithGroup(String groupName)
Returns all users which are the provided group.
|
Collection<String> |
getUsersWithGroup(String groupName,
boolean transitive)
Returns all users which are in the provided group.
|
Collection<String> |
getUsersWithRole(String roleName) |
boolean |
hasAny(String principal,
String resourceName,
String resourceType) |
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)
Deprecated.
since 4.5.7 - use
setProperty(User, String, String) |
void |
updateLastAccessTimestamp(User user)
Updates last access timestamp for the user.
|
static final String SYSTEM_USER
static final String SYSTEM_PSWD
static final String ANONYMOUS_USER
User getUser(String name) throws UnsupportedOperationException
name
- the name of the userUnsupportedOperationException
User getUserById(String id) throws UnsupportedOperationException
id
- user identifierUnsupportedOperationException
@Deprecated User getUser(Subject subject) throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationUser getSystemUser() throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationUser getAnonymousUser() throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationCollection<User> getAllUsers() throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationUser createUser(String name, String pw) throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationUser createUser(String path, String name, String pw) throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationUser changePassword(User user, String newPassword) throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operation@Deprecated User setProperty(User user, String propertyName, javax.jcr.Value propertyValue)
setProperty(User, String, String)
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.User setProperty(User user, String propertyName, String propertyValue)
void setLockTimePeriod(int lockTimePeriod) throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationint getLockTimePeriod() throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationvoid setMaxFailedLoginAttempts(int maxFailedLoginAttempts) throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationint getMaxFailedLoginAttempts() throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationUser addRole(User user, String roleName)
User addGroup(User user, String groupName)
void updateLastAccessTimestamp(User user) throws UnsupportedOperationException
UnsupportedOperationException
- if the current implementation doesn't support this operationboolean hasAny(String principal, String resourceName, String resourceType)
principal
- name of the principalresourceName
- either group or role nameresourceType
- either group or role seeUser removeGroup(User user, String groupName)
User removeRole(User user, String roleName)
Collection<String> getUsersWithGroup(String groupName)
groupName
- name of the groupCollection<String> getUsersWithGroup(String groupName, boolean transitive) throws UnsupportedOperationException
groupName
- name of the grouptransitive
- whether the method should return also users which are in transitive groups of the given group.UnsupportedOperationException
Collection<String> getUsersWithRole(String roleName)
Copyright © 2003–2019 Magnolia International Ltd.. All rights reserved.