org.exist.security
Interface Permission

All Known Implementing Classes:
UnixStylePermission

public interface Permission


Field Summary
static int DEFAULT_PERM
           
static String GROUP_STRING
           
static String OTHER_STRING
           
static int READ
           
static Permission SYSTEM_DEFAULT
           
static int UPDATE
           
static String USER_STRING
           
static int WRITE
           
 
Method Summary
 int getGroupPermissions()
           
 String getOwner()
          Gets the user who owns this resource
 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(DataInput istream)
          Read the Permission from an input stream
 void setGroup(String group)
          Set the owner group
 void setGroupPermissions(int perm)
          Sets permissions for group
 void setOwner(String user)
          Set the owner
 void setOwner(User user)
          Set the owner passed as User object
 void setPermissions(int perm)
          Set permissions
 void setPermissions(String str)
          Set permissions using a string.
 void setPublicPermissions(int perm)
          Set permissions for others
 void setUserPermissions(int perm)
          Set permissions for the owner
 String toString()
          Format permissions
 boolean validate(User user, int perm)
          Check if user has the requested permissions for this resource.
 

Field Detail

DEFAULT_PERM

static final int DEFAULT_PERM
See Also:
Constant Field Values

SYSTEM_DEFAULT

static final Permission SYSTEM_DEFAULT

READ

static final int READ
See Also:
Constant Field Values

WRITE

static final int WRITE
See Also:
Constant Field Values

UPDATE

static final int UPDATE
See Also:
Constant Field Values

USER_STRING

static final String USER_STRING
See Also:
Constant Field Values

GROUP_STRING

static final String GROUP_STRING
See Also:
Constant Field Values

OTHER_STRING

static final String OTHER_STRING
See Also:
Constant Field Values
Method Detail

getGroupPermissions

int getGroupPermissions()

getOwner

String getOwner()
Gets the user who owns this resource

Returns:
The owner value

getOwnerGroup

String getOwnerGroup()
Gets the group

Returns:
The ownerGroup value

getPermissions

int getPermissions()
Get the permissions

Returns:
The permissions value

getPublicPermissions

int getPublicPermissions()
Get the active permissions for others

Returns:
The publicPermissions value

getUserPermissions

int getUserPermissions()
Get the active permissions for the owner

Returns:
The userPermissions value

read

void read(DataInput istream)
          throws IOException
Read the Permission from an input stream

Parameters:
istream - Description of the Parameter
Throws:
IOException - Description of the Exception

setGroup

void setGroup(String group)
Set the owner group

Parameters:
group - The new group value

setGroupPermissions

void setGroupPermissions(int perm)
Sets permissions for group

Parameters:
perm - The new groupPermissions value

setOwner

void setOwner(User user)
Set the owner passed as User object

Parameters:
user - The new owner value

setOwner

void setOwner(String user)
Set the owner

Parameters:
user - The new owner value

setPermissions

void setPermissions(String str)
                    throws SyntaxException
Set permissions using a string. The string has the following syntax: [user|group|other]=[+|-][read|write|update] For example, to set read and write permissions for the group, but not for others: group=+read,+write,other=-read,-write The new settings are or'ed with the existing settings.

Parameters:
str - The new permissions
Throws:
SyntaxException - Description of the Exception

setPermissions

void setPermissions(int perm)
Set permissions

Parameters:
perm - The new permissions value

setPublicPermissions

void setPublicPermissions(int perm)
Set permissions for others

Parameters:
perm - The new publicPermissions value

setUserPermissions

void setUserPermissions(int perm)
Set permissions for the owner

Parameters:
perm - The new userPermissions value

toString

String toString()
Format permissions

Overrides:
toString in class Object
Returns:
Description of the Return Value

validate

boolean validate(User user,
                 int perm)
Check if user has the requested permissions for this resource.

Parameters:
user - The user
perm - The requested permissions
Returns:
true if user has the requested permissions


Copyright (C) Wolfgang Meier. All rights reserved.