wicket.authorization.strategies.role.example
Class User

java.lang.Object
  extended by wicket.authorization.strategies.role.example.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends java.lang.Object
implements java.io.Serializable

Simple user object.

Author:
Eelco Hillenius
See Also:
Serialized Form

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

Constructor Detail

User

public User(java.lang.String uid,
            java.lang.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(java.lang.String role)
Whether this user has the given role.

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

hasAnyRole

public boolean hasAnyRole(wicket.authorization.strategies.role.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 java.lang.String getUid()
Gets the uid.

Returns:
the uid

toString

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


Copyright © 2005-2007 Wicket developers. All Rights Reserved.