info.magnolia.cms.security
Interface User

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

public interface User
extends Serializable

Represents a magnolia user.

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

Method Summary
 void addGroup(String groupName)
          Adds this user to a group.
 void addRole(String roleName)
          Adds a role to this user.
 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 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.
 Subject getSubject()
          Returns the jaas subject if available.
 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)
           
 void setProperty(String propertyName, String value)
          Sets an arbitrary property for this user.
 void setSubject(Subject subject)
          The jass login handler will set the subject.
 

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

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

Throws:
UnsupportedOperationException

addRole

void addRole(String roleName)
             throws UnsupportedOperationException
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

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

Throws:
UnsupportedOperationException

addGroup

void addGroup(String groupName)
              throws UnsupportedOperationException
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

void setEnabled(boolean enabled)

getLanguage

String getLanguage()

getName

String getName()

getPassword

String getPassword()

getProperty

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


setProperty

void setProperty(String propertyName,
                 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

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.


getSubject

Subject getSubject()
Returns the jaas subject if available.


setSubject

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



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