|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<String>
org.apache.wicket.authorization.strategies.role.Roles
public final class Roles
Utility class for working with roles.
Field Summary | |
---|---|
static String |
ADMIN
ADMIN role (for use in annotations) |
static String |
USER
USER role (for use in annotations) |
Constructor Summary | |
---|---|
Roles()
Construct. |
|
Roles(String roles)
Construct. |
|
Roles(String[] roles)
Construct. |
Method Summary | |
---|---|
boolean |
hasAllRoles(Roles roles)
Whether this roles object contains all the provided roles. |
boolean |
hasAnyRole(Roles roles)
Whether this roles object contains any of the provided roles. |
boolean |
hasRole(String role)
Whether this roles object containes the provided role. |
String |
toString()
|
Methods inherited from class java.util.HashSet |
---|
add, clear, clone, contains, isEmpty, iterator, remove, size |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
public static final String USER
public static final String ADMIN
Constructor Detail |
---|
public Roles()
public Roles(String roles)
roles
- Roles as a comma separated list, like "ADMIN, USER"public Roles(String[] roles)
roles
- RolesMethod Detail |
---|
public boolean hasRole(String role)
role
- the role to check
public boolean hasAnyRole(Roles roles)
roles
- the roles to check
public boolean hasAllRoles(Roles roles)
roles
- the roles to check
public String toString()
toString
in class AbstractCollection<String>
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |