|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.security.Permission
Manages the permissions assigned to a ressource. This includes the user who owns the ressource, the owner group and the permissions for user, group and others. Permissions are encoded in a single byte according to common unix conventions.
Field Summary | |
static int |
DEFAULT_PERM
|
static java.lang.String |
DEFAULT_STRING
|
static java.lang.String |
GROUP_STRING
|
static int |
READ
|
static Permission |
SYSTEM_DEFAULT
|
static int |
UPDATE
|
static java.lang.String |
USER_STRING
|
static int |
WRITE
|
Constructor Summary | |
Permission()
|
|
Permission(int perm)
Construct a Permission with given permissions |
|
Permission(java.lang.String user,
java.lang.String group,
int permissions)
Construct a permission with given user, group and permissions |
Method Summary | |
int |
getGroupPermissions()
Get the active permissions for group |
java.lang.String |
getOwner()
Gets the user who owns this resource |
java.lang.String |
getOwnerGroup()
Gets the group |
int |
getPermissions()
Get the permissions |
int |
getPublicPermissions()
Get the active permissions for others |
int |
getUserPermissions()
Get the active permissions for the owner |
void |
read(java.io.DataInput istream)
Read the Permission from an input stream |
void |
setGroup(java.lang.String group)
Set the owner group |
void |
setGroupPermissions(int perm)
Sets permissions for group |
void |
setOwner(java.lang.String user)
Set the owner |
void |
setOwner(User user)
Set the owner passed as User object |
void |
setPermissions(int perm)
Set permissions |
void |
setPermissions(java.lang.String str)
Set permissions using a string. |
void |
setPublicPermissions(int perm)
Set permissions for others |
void |
setUserPermissions(int perm)
Set permissions for the owner |
java.lang.String |
toString()
Format permissions |
boolean |
validate(User user,
int perm)
Check if user has the requested permissions for this resource. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DEFAULT_PERM
public static final Permission SYSTEM_DEFAULT
public static final java.lang.String DEFAULT_STRING
public static final java.lang.String GROUP_STRING
public static final int READ
public static final int UPDATE
public static final java.lang.String USER_STRING
public static final int WRITE
Constructor Detail |
public Permission()
public Permission(int perm)
perm
- Description of the Parameterpublic Permission(java.lang.String user, java.lang.String group, int permissions)
user
- Description of the Parametergroup
- Description of the Parameterpermissions
- Description of the ParameterMethod Detail |
public int getGroupPermissions()
public java.lang.String getOwner()
public java.lang.String getOwnerGroup()
public int getPermissions()
public int getPublicPermissions()
public int getUserPermissions()
public void read(java.io.DataInput istream) throws java.io.IOException
istream
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void setGroup(java.lang.String group)
group
- The new group valuepublic void setGroupPermissions(int perm)
perm
- The new groupPermissions valuepublic void setOwner(User user)
user
- The new owner valuepublic void setOwner(java.lang.String user)
user
- The new owner valuepublic void setPermissions(java.lang.String str) throws SyntaxException
str
- The new permissions
SyntaxException
- Description of the Exceptionpublic void setPermissions(int perm)
perm
- The new permissions valuepublic void setPublicPermissions(int perm)
perm
- The new publicPermissions valuepublic void setUserPermissions(int perm)
perm
- The new userPermissions valuepublic java.lang.String toString()
public boolean validate(User user, int perm)
user
- The userperm
- The requested permissions
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |