org.locomotive.loco.perm
Class Role
java.lang.Object
|
+--org.locomotive.loco.perm.PermissionSet
|
+--org.locomotive.loco.perm.Role
- public class Role
- extends PermissionSet
- implements java.io.Serializable
Provides a data structure for a role (a set of permissions). Essentially
is a subclass of PermissionSet extended with a name and an id.
- See Also:
- Serialized Form
Constructor Summary |
Role(java.lang.String roleName)
Creates a role associated with a name. |
Role(java.lang.String roleName,
int roleId,
java.util.Vector ints)
Creates a role with complete role information. |
Method Summary |
int |
getId()
Returns the id of the role. |
java.lang.String |
getName()
Returns the name of the role. |
void |
setId(int roleId)
Sets the id of the role. |
Methods inherited from class org.locomotive.loco.perm.PermissionSet |
and,
clear,
clone,
exists,
get,
getPermTable,
getSetPerms,
getUserid,
initialize,
isSet,
isSet,
isSet,
isSubsetOf,
names,
or,
set,
set,
setAll,
setBitfield,
setBitfield,
setOnOrOff,
setOnOrOff,
setUserid,
size,
toArray,
toInts,
toString,
unset,
unset,
xor |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Role
public Role(java.lang.String roleName)
- Creates a role associated with a name. This constructor is used
before inserting the role into the database, which will assign it
a unique id.
- Parameters:
roleName
- name of role to be created
Role
public Role(java.lang.String roleName,
int roleId,
java.util.Vector ints)
- Creates a role with complete role information. This constructor
is used when the database is loading role information into the
Role data structure.
- Parameters:
roleName
- name of roleroleId
- id of rolebits
- Vector of Integers representing the permission bitfield
getName
public java.lang.String getName()
- Returns the name of the role.
- Returns:
- String name of the role
getId
public int getId()
- Returns the id of the role.
- Returns:
- int id of the role
setId
public void setId(int roleId)
- Sets the id of the role.
- Parameters:
roleId
- id of role