public class DirectoryResource extends AbstractResource
The following is the defined access modes:
Rights objects for this resource are made of one mandatory bitfield having 8 bits of permissions and one optional boolean expression.
The permissions bits are defined as follows:
Bit "logic" specifies the operation of the optional boolean expression and is only taken into consideration when the expression is present:
The directory package uses package private methods defined in this class for access rights checks. The interpretation of various access modes and the meaning of particular operations against the directory nodes and attributes is beyond control of this resource plugin.
Modifier and Type | Class and Description |
---|---|
class |
DirectoryResource.DirectoryPool
Implements the directory variable pool.
|
private class |
DirectoryResource.SharedData
Implements the directory variable pool shared data.
|
Modifier and Type | Field and Description |
---|---|
static int |
DIR_ADD_ACCESS
ADD access mode for directory resource
|
static int |
DIR_CREATE_ACCESS
CREATE access mode for directory resource
|
static int |
DIR_DELETE_ACCESS
DELETE access mode for directory resource
|
static int |
DIR_ENUMERATE_ACCESS
ENUMERATE access mode for directory resource
|
static int |
DIR_READ_ACCESS
READ access mode for directory resource
|
static int |
DIR_WRITE_ACCESS
WRITE access mode for directory resource
|
objectPointer, resourceIndex, sm
Constructor and Description |
---|
DirectoryResource()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
checkAccess(java.lang.String oId,
int mode)
Checks the given node for the specified access.
|
private int |
checkSingle(java.lang.String oId,
int mode,
DirectoryRights rights)
Implements a worker that performs access rights check on a single
instance of the DirectoryRights object.
|
Description[] |
describeRights()
Returns an array of descriptions, one object per the plugin's access
rights item.
|
private boolean |
dirAccessWorker(java.lang.String oId,
int mode)
Implements generalized access rights check worker.
|
java.lang.Object |
getLibrary()
Returns the plugin's exported variables and functions.
|
Rights |
getRightsInstance(java.lang.Object[] rights)
Instantiates a plugin's class that implements the Rights interface,
using the array of objects representing a set of access rights fields.
|
java.lang.String |
getTypeName()
Returns the plugin resource type name as a string.
|
boolean |
isInstanceNameValid(java.lang.String resource)
Checks whether a given string is a valid resource name
for this resource type.
|
boolean |
isRightsSetValid(java.lang.Object[] rights)
Checks whether a given array of objects representing a set of access
rights fields is acceptable.
|
associate, attach, disassociate, getEnclosingScope, getLink, getPermissions, init, refresh, registeredAs, toString
public static final int DIR_ENUMERATE_ACCESS
public static final int DIR_READ_ACCESS
public static final int DIR_WRITE_ACCESS
public static final int DIR_ADD_ACCESS
public static final int DIR_CREATE_ACCESS
public static final int DIR_DELETE_ACCESS
public java.lang.String getTypeName()
public Description[] describeRights()
Description
s, one per each plugin's access
rights item.public Rights getRightsInstance(java.lang.Object[] rights)
rights
- an array of objects of proper types representing items in a set
of access rightspublic boolean isInstanceNameValid(java.lang.String resource)
Valid names are:
All these checks are performed by IdUtils.normalize method.
resource
- string naming a resourcetrue
if the name is syntactically correctpublic boolean isRightsSetValid(java.lang.Object[] rights)
This method returns true
only if:
rights
- an array of objects of proper types representing items in a set
of access rightstrue
if the array is acceptable for an instance
of access rightspublic java.lang.Object getLibrary()
This implementation exports a library.
getLibrary
in interface Resource
getLibrary
in class AbstractResource
boolean checkAccess(java.lang.String oId, int mode)
oId
- directory object ID - resource instance namemode
- requested access modetrue
if access is allowed.private boolean dirAccessWorker(java.lang.String oId, int mode)
oId
- directory object ID - resource instance namemode
- requested access modetrue
if access is allowed.private int checkSingle(java.lang.String oId, int mode, DirectoryRights rights)
oId
- directory object ID - resource instance namemode
- requested access moderights
- instance of DirectoryRights to check