|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.security.AbstractUser info.magnolia.cms.security.MgnlUser
public class MgnlUser
User for 4.5 instance In difference from old MgnlUser, this class operates directly on JCR session and with JCR nodes/properties as our hierarchy managers are not available at the login time. Also in difference from MgnlUser, this class doesn't keep around instance of the user node! TODO: Test performance impact of such change.
Constructor Summary | |
---|---|
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)
|
Method Summary | |
---|---|
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 to which this user belongs to, collected recursively including. |
Collection<String> |
getAllRoles()
Get all roles assigned to this user, collected recursively including groups/subgroups. |
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, Value) 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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.security.Principal |
---|
equals, hashCode |
Constructor Detail |
---|
public MgnlUser(String name, String realm, Collection<String> groups, Collection<String> roles, Map<String,String> properties)
public MgnlUser(String name, String realm, Collection<String> groups, Collection<String> roles, Map<String,String> properties, String path, String uuid)
Method Detail |
---|
public boolean inGroup(String groupName)
inGroup
in interface User
groupName
- the name of the group
public void removeGroup(String groupName) throws UnsupportedOperationException
removeGroup
in interface User
groupName
-
UnsupportedOperationException
public void addGroup(String groupName) throws UnsupportedOperationException
addGroup
in interface User
groupName
-
UnsupportedOperationException
public boolean isEnabled()
User
isEnabled
in interface User
@Deprecated public void setEnabled(boolean enabled)
UserManager.setProperty(User, String, Value)
instead
setEnabled
in interface User
public boolean hasRole(String roleName)
hasRole
in interface User
roleName
- the name of the role
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 role
UnsupportedOperationException
public int getFailedLoginAttempts()
public Calendar getReleaseTime()
public String getName()
getName
in interface User
getName
in interface Principal
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
getGroups
in interface User
public Collection<String> getAllGroups()
User
getAllGroups
in interface User
public Collection<String> getRoles()
User
getRoles
in interface 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
instead
User
setProperty
in interface User
public String getIdentifier()
User
getIdentifier
in interface User
@Deprecated public String getUuid()
getIdentifier()
instead
public String toString()
toString
in interface Principal
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |