info.magnolia.cms.security
Interface User

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

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 user is in
 java.lang.String getLanguage()
          get user language
 java.lang.String getName()
          get user name
 java.lang.String getPassword()
          get user password
 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 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()
get user language

Returns:
language string

getName

java.lang.String getName()
get user name

Returns:
name string

getPassword

java.lang.String getPassword()
get user password

Returns:
password string

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 user is in


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 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-2010 Magnolia International Ltd.. All Rights Reserved.