public class MgnlUser extends AbstractUser implements User, Serializable
Constructor and Description |
---|
MgnlUser(String name,
String realm,
Collection<String> groups,
Collection<String> roles,
Map<String,String> properties) |
MgnlUser(String name,
String realm,
Collection<String> groups,
Collection<String> roles,
Map<String,String> properties,
String path,
String uuid) |
Modifier and Type | Method and Description |
---|---|
void |
addGroup(String groupName)
Adds this user to a group.
|
void |
addRole(String roleName)
Adds a role to this user.
|
protected String |
decodePassword(String encodedPassword)
Deprecated.
|
Collection<String> |
getAllGroups()
Get all groups this user belongs to, collected recursively including supergroups.
|
Collection<String> |
getAllRoles()
Get all roles assigned to this user, collected recursively including groups and supergroups.
|
int |
getFailedLoginAttempts() |
Collection<String> |
getGroups()
Get groups that are directly assigned to the user.
|
String |
getIdentifier()
Gets user identifier.
|
String |
getLanguage() |
String |
getName() |
String |
getPassword() |
String |
getPath() |
String |
getProperty(String propertyName)
Gets an arbitrary property from this user.
|
String |
getRealm() |
Calendar |
getReleaseTime() |
Collection<String> |
getRoles()
Get roles that are directly assigned to the user.
|
Content |
getUserNode()
Deprecated.
since 4.5, use
UserManager.updateLastAccessTimestamp(User) instead |
String |
getUuid()
Deprecated.
since 4.5.1, use
getIdentifier() instead |
boolean |
hasRole(String roleName)
Is this user in a specified role?
|
boolean |
inGroup(String groupName)
Is this user in a specified group?
|
boolean |
isEnabled()
Returns false if the user was explicitly disabled.
|
void |
removeGroup(String groupName)
Remove a group.
|
void |
removeRole(String roleName)
Remove a role.
|
void |
setEnabled(boolean enabled)
Deprecated.
since 4.5, use
UserManager.setProperty(User, String, String) instead |
void |
setLastAccess()
Deprecated.
since 4.5, use
UserManager.updateLastAccessTimestamp(User) instead |
void |
setPath(String path)
Deprecated.
|
void |
setProperty(String propertyName,
String value)
Deprecated.
since 4.5, use
UserManager instead |
String |
toString() |
public MgnlUser(String name, String realm, Collection<String> groups, Collection<String> roles, Map<String,String> properties)
public boolean inGroup(String groupName)
public void removeGroup(String groupName) throws UnsupportedOperationException
removeGroup
in interface User
UnsupportedOperationException
public void addGroup(String groupName) throws UnsupportedOperationException
addGroup
in interface User
groupName
- group the user should be added toUnsupportedOperationException
public boolean isEnabled()
User
@Deprecated public void setEnabled(boolean enabled)
UserManager.setProperty(User, String, String)
insteadsetEnabled
in interface User
public boolean hasRole(String roleName)
public void removeRole(String roleName) throws UnsupportedOperationException
User
removeRole
in interface User
UnsupportedOperationException
public void addRole(String roleName) throws UnsupportedOperationException
User
addRole
in interface User
roleName
- the name of the roleUnsupportedOperationException
public int getFailedLoginAttempts()
public Calendar getReleaseTime()
public String getName()
public String getPassword()
getPassword
in interface User
@Deprecated protected String decodePassword(String encodedPassword)
public String getLanguage()
getLanguage
in interface User
public String getProperty(String propertyName)
User
getProperty
in interface User
public Collection<String> getGroups()
User
public Collection<String> getAllGroups()
User
getAllGroups
in interface User
public Collection<String> getRoles()
User
public Collection<String> getAllRoles()
User
getAllRoles
in interface User
public String getPath()
@Deprecated public void setPath(String path)
public String getRealm()
@Deprecated public void setLastAccess()
UserManager.updateLastAccessTimestamp(User)
instead@Deprecated public Content getUserNode()
UserManager.updateLastAccessTimestamp(User)
instead@Deprecated public void setProperty(String propertyName, String value)
UserManager
insteadUser
setProperty
in interface User
public String getIdentifier()
User
getIdentifier
in interface User
@Deprecated public String getUuid()
getIdentifier()
insteadCopyright © 2003–2016 Magnolia International Ltd.. All rights reserved.