net.drijf.javaone
Class RoleImpl
java.lang.Object
|
+--net.drijf.javaone.RoleImpl
- All Implemented Interfaces:
- Role
- public class RoleImpl
- extends java.lang.Object
- implements Role
This class implements a simple role assignment. Normally, you would
like to define roles based on property files or read them from a
database.
- Author:
- Otto Moerbeek
Field Summary |
static Role |
ALL
The role that allows anything |
static Role |
ENTER
A role that allows clas loading of a specific class |
static Role |
NOTHING
The role that disallows anything. |
static Role |
READER
A role that allows classloading and reading of files, |
Constructor Summary |
RoleImpl(java.lang.String name,
java.security.Permission[] perms)
Construct a new role. |
Method Summary |
java.lang.String |
getName()
Return the name of this role. |
java.security.PermissionCollection |
getPermissions()
Return the permissions assocated with this role. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NOTHING
public static final Role NOTHING
- The role that disallows anything.
ALL
public static final Role ALL
- The role that allows anything
READER
public static final Role READER
- A role that allows classloading and reading of files,
ENTER
public static final Role ENTER
- A role that allows clas loading of a specific class
RoleImpl
public RoleImpl(java.lang.String name,
java.security.Permission[] perms)
- Construct a new role.
- Parameters:
name
- the name of the role.perms
- the permissions to associate with this role.
getPermissions
public java.security.PermissionCollection getPermissions()
- Return the permissions assocated with this role.
- Specified by:
getPermissions
in interface Role
getName
public java.lang.String getName()
- Return the name of this role.
- Specified by:
getName
in interface Role