|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bees.core.security.Permission
Describes an abstract permission, consisting of a string name and an optional set of actions from the set {read,write,execute}.
Field Summary | |
static int |
APPEND
Action determining whether or not the property specified by the permission name is appendable. |
static int |
EXECUTE
Action determining whether or not the property specified by the permission name is executable. |
static int |
READ
Action determining whether or not the property specified by the permission name is readable. |
static int |
WRITE
Action determining whether or not the property specified by the permission name is writable. |
Fields inherited from interface bees.core.security.PermissionTypes |
PERMISSION_BASIC, PERMISSION_CLASSES, PERMISSION_COUNT, PERMISSION_ENUMERATION, PERMISSION_FILE, PERMISSION_FLOAT, PERMISSION_INTEGER, PERMISSION_IP_ADDRESS, PERMISSION_MAX, PERMISSION_MAX_FLOAT, PERMISSION_MAX_INTEGER, PERMISSION_MIN, PERMISSION_MIN_FLOAT, PERMISSION_MIN_INTEGER, PERMISSION_NULL, PERMISSION_RANGE |
Constructor Summary | |
Permission()
Construct an empty Permission. |
|
Permission(java.lang.String name)
Creates a new permission with the given human-readable name and no actions. |
|
Permission(java.lang.String name,
java.lang.String actions)
Creates a permission with a set of actions. |
Method Summary | |
void |
bound(Permission what)
Bound this permission's actions to the ones available in what. |
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object obj)
Tests for exact equality: the name and actions must precisely match. |
java.lang.String |
getAction()
|
int |
getActionMask()
|
java.lang.String |
getName()
|
protected int |
getTypeID()
|
void |
grant(Permission what)
Grant the actions in "what" to this permission. |
boolean |
implies(Permission p)
Test whether this permission implies the given permission. |
static Permission |
instantiate(byte[] flattened)
Instantiate a Permission object from the given byte array. |
static Permission |
instantiate(XdrByteArray xba)
Instantiate a Permission object from the given byte array. |
void |
marshal(XdrByteArray xba)
Marshal this object into the given byte array. |
int |
marshalledLength()
|
boolean |
nameImplies(Permission p)
Test whether this permission's name implies the given permission. |
protected void |
orActionMask(int bits)
|
void |
revoke(Permission what)
Revoke the actions in "what" from this permission. |
byte[] |
toBytes()
|
java.lang.String |
toString()
|
void |
unmarshal(XdrByteArray xba)
Unmarshal this object from the given byte array. |
void |
updateHash(bees.util.MD5 digest)
Update a an MD5 object with the value of this permission. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int READ
public static final int WRITE
public static final int EXECUTE
public static final int APPEND
Constructor Detail |
public Permission(java.lang.String name, java.lang.String actions)
name
- The name of the permission.actions
- The actions granted by this permission.public Permission(java.lang.String name)
name
- The name of the permission.public Permission()
Method Detail |
protected int getTypeID()
public final int getActionMask()
protected void orActionMask(int bits)
bits
- The bits to or into the action mask.public java.lang.String getAction()
public final java.lang.String getName()
public final boolean nameImplies(Permission p)
p
- The permission to match.public boolean implies(Permission p)
p
- The permission to match.public void grant(Permission what)
what
- The permissions that should be granted to this permission.public void revoke(Permission what)
what
- The permissions that should be revoked from this permission.public void bound(Permission what)
what
- The permission that this permission should be bounded by.public void updateHash(bees.util.MD5 digest)
XXX A bit hacky.
digest
- The digest to update.public int marshalledLength()
public void marshal(XdrByteArray xba)
xba
- The destination for the flattened version of this Permission.public void unmarshal(XdrByteArray xba)
xba
- The source of the flattened version of this Permission.public byte[] toBytes()
public static Permission instantiate(XdrByteArray xba)
xba
- The source of the flattened version of a Permission.public static Permission instantiate(byte[] flattened)
flattened
- The source of the flattened version of a Permission.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object to compare this one against.public java.lang.Object clone()
clone
in class java.lang.Object
Object.clone()
|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |