info.magnolia.cms.security
Interface User

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

public interface User
extends java.io.Serializable

Represents a magnolia user.

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

Method Summary
 void addGroup(java.lang.String groupName)
          Adds this user to a group.
 void addRole(java.lang.String roleName)
          Adds a role to this user.
 java.util.Collection<java.lang.String> getAllGroups()
          Get all groups to which this user belongs to, collected recursively including.
 java.util.Collection<java.lang.String> getAllRoles()
          Get all roles assigned to this user, collected recursively including groups/subgroups.
 java.util.Collection<java.lang.String> getGroups()
          Get groups that are directly assigned to the user.
 java.lang.String getLanguage()
           
 java.lang.String getName()
           
 java.lang.String getPassword()
           
 java.lang.String getProperty(java.lang.String propertyName)
          Gets an arbitrary property from this user.
 java.util.Collection<java.lang.String> getRoles()
          Get roles that are directly assigned to the user.
 javax.security.auth.Subject getSubject()
          Returns the jaas subject if available.
 boolean hasRole(java.lang.String roleName)
          Is this user in a specified role?
 boolean inGroup(java.lang.String groupName)
          Is this user in a specified group?
 boolean isEnabled()
          Returns false if the user was explicitly disabled.
 void removeGroup(java.lang.String groupName)
          Remove a group.
 void removeRole(java.lang.String roleName)
          Remove a role.
 void setEnabled(boolean enabled)
           
 void setProperty(java.lang.String propertyName, java.lang.String value)
          Sets an arbitrary property for this user.
 void setSubject(javax.security.auth.Subject subject)
          The jass login handler will set the subject.
 

Method Detail

hasRole

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

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

removeRole

void removeRole(java.lang.String roleName)
                throws java.lang.UnsupportedOperationException
Remove a role. Implementation is optional

Throws:
java.lang.UnsupportedOperationException

addRole

void addRole(java.lang.String roleName)
             throws java.lang.UnsupportedOperationException
Adds a role to this user. Implementation is optional

Parameters:
roleName - the name of the role
Throws:
java.lang.UnsupportedOperationException

inGroup

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

Returns:
true if in group

removeGroup

void removeGroup(java.lang.String groupName)
                 throws java.lang.UnsupportedOperationException
Remove a group. Implementation is optional

Throws:
java.lang.UnsupportedOperationException

addGroup

void addGroup(java.lang.String groupName)
              throws java.lang.UnsupportedOperationException
Adds this user to a group. Implementation is optional

Throws:
java.lang.UnsupportedOperationException

isEnabled

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


setEnabled

void setEnabled(boolean enabled)

getLanguage

java.lang.String getLanguage()

getName

java.lang.String getName()

getPassword

java.lang.String getPassword()

getProperty

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


setProperty

void setProperty(java.lang.String propertyName,
                 java.lang.String value)
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.


getGroups

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


getAllGroups

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


getRoles

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


getAllRoles

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


getSubject

javax.security.auth.Subject getSubject()
Returns the jaas subject if available.


setSubject

void setSubject(javax.security.auth.Subject subject)
The jass login handler will set the subject.



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