info.magnolia.cms.security
Interface User

All Superinterfaces:
Principal, Serializable
All Known Implementing Classes:
AbstractUser, DummyUser, ExternalUser, MgnlUser, RescueSecuritySupport.RescueUser

public interface User
extends Principal, Serializable

Represents a magnolia user.

Version:
$Revision:2558 $ ($Author:scharles $)
Author:
philipp

Method Summary
 void addGroup(String groupName)
          Deprecated. since 4.5 - use UserManager.addGroup(User, String) instead.
 void addRole(String roleName)
          Deprecated. since 4.5 - use UserManager.addRole(User, String) instead.
 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.
 Collection<String> getGroups()
          Get groups that are directly assigned to the user.
 String getIdentifier()
          Gets user identifier.
 String getLanguage()
           
 String getName()
           
 String getPassword()
           
 String getProperty(String propertyName)
          Gets an arbitrary property from this user.
 Collection<String> getRoles()
          Get roles that are directly assigned to the user.
 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)
          Deprecated. since 4.5 - use UserManager.removeGroup(User, String) instead.
 void removeRole(String roleName)
          Deprecated. since 4.5 - use UserManager.removeRole(User, String) instead.
 void setEnabled(boolean enabled)
          Deprecated. since 4.5, use UserManager.setProperty(User, String, Value) instead
 void setProperty(String propertyName, String value)
          Deprecated. since 4.5, use UserManager.setProperty(User, String, Value) instead
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Method Detail

hasRole

boolean hasRole(String roleName)
Is this user in a specified role?

Parameters:
roleName - the name of the role
Returns:
true if in role

removeRole

@Deprecated
void removeRole(String roleName)
                throws UnsupportedOperationException
Deprecated. since 4.5 - use UserManager.removeRole(User, String) instead.

Remove a role. Implementation is optional

Throws:
UnsupportedOperationException

addRole

@Deprecated
void addRole(String roleName)
             throws UnsupportedOperationException
Deprecated. since 4.5 - use UserManager.addRole(User, String) instead.

Adds a role to this user. Implementation is optional

Parameters:
roleName - the name of the role
Throws:
UnsupportedOperationException

inGroup

boolean inGroup(String groupName)
Is this user in a specified group?

Returns:
true if in group

removeGroup

@Deprecated
void removeGroup(String groupName)
                 throws UnsupportedOperationException
Deprecated. since 4.5 - use UserManager.removeGroup(User, String) instead.

Remove a group. Implementation is optional

Throws:
UnsupportedOperationException

addGroup

@Deprecated
void addGroup(String groupName)
              throws UnsupportedOperationException
Deprecated. since 4.5 - use UserManager.addGroup(User, String) instead.

Adds this user to a group. Implementation is optional

Throws:
UnsupportedOperationException

isEnabled

boolean isEnabled()
Returns false if the user was explicitly disabled. Implementations should return true by default if the status is unknown.


setEnabled

@Deprecated
void setEnabled(boolean enabled)
Deprecated. since 4.5, use UserManager.setProperty(User, String, Value) instead


getLanguage

String getLanguage()

getName

String getName()
Specified by:
getName in interface Principal

getPassword

String getPassword()

getProperty

String getProperty(String propertyName)
Gets an arbitrary property from this user.


setProperty

@Deprecated
void setProperty(String propertyName,
                            String value)
Deprecated. since 4.5, use UserManager.setProperty(User, String, Value) instead

Sets an arbitrary property for this user. Values are currently Strings; we'd need some kind of abstract encoding mechanism to allow other types if needed.


getIdentifier

String getIdentifier()
Gets user identifier.


getGroups

Collection<String> getGroups()
Get groups that are directly assigned to the user.


getAllGroups

Collection<String> getAllGroups()
Get all groups to which this user belongs to, collected recursively including.


getRoles

Collection<String> getRoles()
Get roles that are directly assigned to the user.


getAllRoles

Collection<String> getAllRoles()
Get all roles assigned to this user, collected recursively including groups/subgroups.



Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.