info.magnolia.cms.security
Class DummyUser

java.lang.Object
  extended by info.magnolia.cms.security.AbstractUser
      extended by info.magnolia.cms.security.DummyUser
All Implemented Interfaces:
User, java.io.Serializable

public class DummyUser
extends AbstractUser

Dummy user implementation returned when an actual user instance can't be instantiated.

Version:
$Revision:9391 $ ($Author:scharles $)
Author:
Sameer Charles
See Also:
Serialized Form

Field Summary
 
Fields inherited from class info.magnolia.cms.security.AbstractUser
subject
 
Method Summary
 void addGroup(java.lang.String groupName)
          Adds this user to a group.
 void addRole(java.lang.String roleName)
          Simply log that its a dummy 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
 boolean hasRole(java.lang.String roleName)
          Dummy user has full access, always returns true.
 boolean inGroup(java.lang.String groupName)
          Always returns true.
 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)
          Simply log that its a dummy user.
 void setEnabled(boolean enabled)
           
 void setProperty(java.lang.String propertyName, java.lang.String value)
          Sets an arbitrary property for this user.
 
Methods inherited from class info.magnolia.cms.security.AbstractUser
getSubject, setSubject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasRole

public boolean hasRole(java.lang.String roleName)
Dummy user has full access, always returns true.

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

removeRole

public void removeRole(java.lang.String roleName)
                throws java.lang.UnsupportedOperationException
Simply log that its a dummy user.

Throws:
java.lang.UnsupportedOperationException

addRole

public void addRole(java.lang.String roleName)
             throws java.lang.UnsupportedOperationException
Simply log that its a dummy user.

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

inGroup

public boolean inGroup(java.lang.String groupName)
Always returns true.

Returns:
true if in group

removeGroup

public void removeGroup(java.lang.String groupName)
                 throws java.lang.UnsupportedOperationException
Description copied from interface: User
Remove a group. Implementation is optional

Throws:
java.lang.UnsupportedOperationException

addGroup

public void addGroup(java.lang.String groupName)
              throws java.lang.UnsupportedOperationException
Description copied from interface: User
Adds this user to a group. Implementation is optional

Throws:
java.lang.UnsupportedOperationException

isEnabled

public boolean isEnabled()
Description copied from interface: User
Returns false if the user was explicitly disabled. Implementations should return true by default if the status is unknown.


setEnabled

public void setEnabled(boolean enabled)

getLanguage

public java.lang.String getLanguage()
Description copied from interface: User
get user language

Returns:
language string

getName

public java.lang.String getName()
Description copied from interface: User
get user name

Returns:
name string

getPassword

public java.lang.String getPassword()
Description copied from interface: User
get user password

Returns:
password string

getProperty

public java.lang.String getProperty(java.lang.String propertyName)
Description copied from interface: User
Gets an arbitrary property from this user.


setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.String value)
Description copied from interface: User
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

public java.util.Collection<java.lang.String> getGroups()
Description copied from interface: User
get groups that user is in


getAllGroups

public java.util.Collection<java.lang.String> getAllGroups()
Description copied from interface: User
get all groups to which this user belongs to, collected recursively including


getRoles

public java.util.Collection<java.lang.String> getRoles()
Description copied from interface: User
get roles that are directly assigned to user


getAllRoles

public java.util.Collection<java.lang.String> getAllRoles()
Description copied from interface: User
get all roles assigned to this user, collected recursively including groups/subgroups



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