|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zphinx.spine.security.PermissionLevel
public class PermissionLevel
PermissionLevel represents an object which mimics the default unix octal ACL system defined by the presence of Owner,group and public access rights.
It allows flags for setting the values Read,Write, and Execute flags and also provides a constructor which allows the client programmer to directly specify the octal numerical equivalent of a resources access rights. i.e calling :
PermissionLevel pl = new PermissionLevel({7,5,5});
Will create a new permissionLevel allowing the owner read,write, execute access and group, public access rights of read and execute.
Copyright ©Zphinx Software Solutions
| Constructor Summary | |
|---|---|
PermissionLevel()
Default constructor which initializes the permission level of this object to it's unix equivalent of 755 as defined by: Owner - Read,Write,Execute Group - Read,NoWrite,Execute public - Read,NoWrite,Execute |
|
PermissionLevel(boolean[] ownerPermission,
boolean[] groupPermission,
boolean[] publicPermission)
Constructor allowing the client programmer to specify the contents of the permissionLevel using boolean arrays. |
|
PermissionLevel(int[] permit)
Constructor which uses the numerical(octal) equivalent of the unit access control rights system to assign permission flags to this PermissionLevel. |
|
| Method Summary | |
|---|---|
boolean[] |
getGroupPermission()
Gets the group permissions for this object |
boolean |
getGroupPermission(int i)
Gets the group read,write and execute flags for this permission object |
boolean[] |
getOwnerPermission()
Gets the owner permissions for this object |
boolean |
getOwnerPermission(int i)
Gets the owner's read,write and execute flags for this permission object |
int[] |
getPermissionOctal()
Gets the octal representation of this permissionLevel |
boolean[] |
getPublicPermission()
Gets the public permissions for this object |
boolean |
getPublicPermission(int i)
Gets the public read,write and execute flags for this permission object |
void |
setGroupPermission(boolean[] groupPermission)
Sets the group permissions for this object |
void |
setGroupPermission(int index,
String value)
Sets the read,write and execute flags for the groupPermission in the order shown i.e [R,W,X].at the stated index |
void |
setOwnerPermission(boolean[] ownerPermission)
Sets the owner permissions for this object |
void |
setOwnerPermission(int index,
String value)
Sets the read,write and execute flags for the ownerPermission in the order shown i.e [R,W,X].at the stated index |
void |
setPublicPermission(boolean[] publicPermission)
Sets the public permissions for this object |
void |
setPublicPermission(int index,
String value)
Sets the read,write and execute flags for the publicPermission in the order shown i.e [R,W,X].at the stated index |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PermissionLevel()
public PermissionLevel(int[] permit)
throws SpineException
Any of these octal numbers can be set as a member of the int array passed to this constructor. The values are then transposed to a boolean array which is determined respectively and is symbolized using a boolean array to represent
[Read,Write,Execute] i.e
[true,false,true] will yield
[Read,NoWrite,Execute] or 5 in octal notation
permit - The array of int flags which define the access rights.
SpineException - A spine exception is thrown should there be an error creating a permission level
public PermissionLevel(boolean[] ownerPermission,
boolean[] groupPermission,
boolean[] publicPermission)
throws SpineException
[ReadFlag,WriteFlag,ExecuteFlag] eg if a boolean array is set as [true,false,false] for a public permission set, then this permissionLevel object will have a unix equivalent of readOnly or [Read,NoWrite,NoExecute].
ownerPermission - The owner's permission boolean arraygroupPermission - The group's permission boolean arraypublicPermission - The public's permission boolean array
SpineException - A spine exception is thrown should there be an error creating a permission level| Method Detail |
|---|
public boolean[] getGroupPermission()
public boolean[] getOwnerPermission()
public boolean[] getPublicPermission()
public int[] getPermissionOctal()
public String toString()
toString in class Objectpublic boolean getGroupPermission(int i)
i - An int denoting location of the flag to get from the boolean array representing the groups permission
public boolean getOwnerPermission(int i)
i - An int denoting location of the flag to get from the boolean array representing the owner's permission
public boolean getPublicPermission(int i)
i - An int denoting location of the flag to get from the boolean array representing the public permission
public void setGroupPermission(int index,
String value)
index - The index of the group permission to setvalue - The value of the group permission to set either true or false
public void setOwnerPermission(int index,
String value)
index - The index of the owner permission to setvalue - The value of the owner permission to set, either true or false
public void setPublicPermission(int index,
String value)
index - The index of the public permission to setvalue - The value to set (true or false)public void setGroupPermission(boolean[] groupPermission)
groupPermission - The groupPermission to set.public void setOwnerPermission(boolean[] ownerPermission)
ownerPermission - The ownerPermission to set.public void setPublicPermission(boolean[] publicPermission)
publicPermission - The publicPermission to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||