org.apache.wicket.examples.authorization
Class User

java.lang.Object
  extended by org.apache.wicket.examples.authorization.User
All Implemented Interfaces:
Serializable, IClusterable

public class User
extends Object
implements IClusterable

Simple user object.

Author:
Eelco Hillenius
See Also:
Serialized Form

Constructor Summary
User(String uid, String roles)
          Construct.
 
Method Summary
 String getUid()
          Gets the uid.
 boolean hasAnyRole(Roles roles)
          Whether this user has any of the given roles.
 boolean hasRole(String role)
          Whether this user has the given role.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

User

public User(String uid,
            String roles)
Construct.

Parameters:
uid - the unique user id
roles - a comma seperated list of roles (e.g. USER,ADMIN)
Method Detail

hasRole

public boolean hasRole(String role)
Whether this user has the given role.

Parameters:
role -
Returns:
whether this user has the given role

hasAnyRole

public boolean hasAnyRole(Roles roles)
Whether this user has any of the given roles.

Parameters:
roles - set of roles
Returns:
whether this user has any of the given roles

getUid

public String getUid()
Gets the uid.

Returns:
the uid

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.