Oracle Content Management SDK

oracle.ifs.common
Class AccessLevel

java.lang.Object
  |
  +--oracle.ifs.common.AccessLevel
All Implemented Interfaces:
java.io.Serializable

public final class AccessLevel
extends java.lang.Object
implements java.io.Serializable

The AccessLevel class. This class is used to manage security on iFS Public Objects (e.g. Folders and Documents). An instance of this class encapsulates a set of operations, that is used as a parameter to methods that grant or revoke permissions, and as the result of inquiring on permissions.

AccessLevel can be viewed as a set of boolean permission flags for up to 64 standard access levels, and an unrestricted number of extendedPermissions. The standard access levels currently defined are:

The Strings used to identify these permissions are by default the English strings used in the descriptions above. Localized translations of these Strings can be used, and accessed using the static string keys,such as ACCESSLEVEL_DISCOVER_KEY.

This class has methods to set and clear the various permission flags, as well as methods to test whether a permission flag is set.

Note: A PermissionBundle can return an AccessLevel which has a few null ExtendedPermissions associated with it. This can happen, in at least the following two ways:

1. The PermissionBundle could have an AccessLevel set, on which enableExtendedPermissions() is called with an array containing nulls elements.

2. The referenced ExtendedPermission objects could have existed properly at the time the PermissionBundle was created, but subsequently freed. This will result in the ExtendedPermission array having null elements.

The developer's code should handle null elements in the ExtendedPermission[] array returned from getExtendedPermissions().getSystemObjectArray().

See Also:
AccessControlList, Serialized Form

Field Summary
static long ACCESSLEVEL_ADDITEM
          Numeric value that designates permission to add an item to a Folder.
static long ACCESSLEVEL_ADDMEMBER
          Numeric value that designates permission to add a DirectoryObject to a DirectoryGroup.
static long ACCESSLEVEL_ADDRELATIONSHIP
          Numeric value that designates permission to relate a PublicObject to another PublicObject.
static long ACCESSLEVEL_ADDVERSION
          Numeric value that designates permission to add a new version to a VersionSeries.
static long ACCESSLEVEL_ADDVERSIONSERIES
          Numeric value that designates permission to add a VersionSeries to a Family.
static long ACCESSLEVEL_ALL
          Numeric value that designates "all permissions".
static long ACCESSLEVEL_CREATE
          Numeric value that designates permission to create an instance of a Class.
static long ACCESSLEVEL_DELETE
          Numeric value that designates permission to delete, undelete or free an object.
static long ACCESSLEVEL_DEQUEUE
          Numeric value that designates permission to dequeue messages from a queue.
static long ACCESSLEVEL_DISCOVER
          Numeric value that designates Discover permission.
static long ACCESSLEVEL_ENQUEUE
          Numeric value that designates permission to enqueue messages on to a queue.
static long ACCESSLEVEL_GET_CONTENT
          Numeric value that designates permission to get content of a Document.
static long ACCESSLEVEL_GRANT
          Numeric value that designates permission to change a Publicobject's Owner, ACL AdministrationGroup to another user
static long ACCESSLEVEL_LOCK
          Numeric value that designates permission to lock or unlock PublicObjects.
static long ACCESSLEVEL_NONE
          Numeric value that designates "no permissions".
static long ACCESSLEVEL_REMOVEITEM
          Numeric value that designates permission to remove an item from a Folder.
static long ACCESSLEVEL_REMOVEMEMBER
          Numeric value that designates permission to remove a DirectoryObject from a DirectoryGroup.
static long ACCESSLEVEL_REMOVERELATIONSHIP
          Numeric value that designates permission to remove a Relationship between a PublicObject.
static long ACCESSLEVEL_REMOVEVERSION
          Numeric value that designates permission to remove a version from a VersionSeries.
static long ACCESSLEVEL_REMOVEVERSIONSERIES
          Numeric value that designates permission to remove a VersionSeries from a Family.
static long ACCESSLEVEL_SELECTORACCESS
          Numeric value that designates permission to search a Class in a Selector or a Search.
static long ACCESSLEVEL_SET_ATTR
          Numeric value that designates permission to update an object attribute.
static long ACCESSLEVEL_SET_CONTENT
          Numeric value that designates permission to update content of a Document.
static long ACCESSLEVEL_SETDEFAULTVERSION
          Numeric value that designates permission to change the default version or VersionSeries of a Family or VersionSeries.
static long ACCESSLEVEL_SETPOLICY
          Numeric value that designates permission to change the PolicyPropertyBundle associated with a PublicObject.
static java.lang.String ACCESSLEVEL_TOSTRING_DELIMITER_KEY
          resourceBundle key used to get the permission delimiter for a String representation for an AccessLevel.
static java.lang.String ACCESSLEVEL_TOSTRING_PREFIX_KEY
          resourceBundle key used to get the prefix for a String representation for an AccessLevel.
static java.lang.String ACCESSLEVEL_TOSTRING_SUFFIX_KEY
          resourceBundle key used to get the suffix for a String representation for an AccessLevel.
static long ACCESSLEVEL_UNLOCK
          Numeric value that designates permission to unlock PublicObjects.
 
Constructor Summary
AccessLevel()
          default Constructor for an AccessLevel.
AccessLevel(AccessLevel level)
          Clone an AccessLevel
AccessLevel(long access_level)
          Construct an AccessLevel, with a long accesslevel value.
AccessLevel(java.lang.String[] stringLevels)
          constructor to initialize set of permissions, specified by an array of Strings.
AccessLevel(java.lang.String[] stringLevels, LibrarySessionInterface session)
          constructor to initialize set of permissions, specified by an array of Strings and a specific LibrarySessionInterface.
AccessLevel(java.lang.String[] stringLevels, Localizer localizer)
          constructor to initialize set of permissions, specified by an array of Strings and a specific Localizer.
 
Method Summary
 void add(AccessLevel level, LibrarySessionInterface sess)
          Add permissions specified in another AccessLevel to this AccessLevel
 void clearAllExtendedPermissions()
          Clear all extended permission flags.
 void clearAllPermissions()
          Clear all permission flags - standard and extended.
 void clearAllStandardPermissions()
          Clear all standard permission flags.
 void disableExtendedPermission(ExtendedPermissionInterface perm)
          Disable an extended perrmission.
 void disableExtendedPermission(ExtendedPermissionInterface[] perms)
          Disable a set of extended perrmissions.
 void disableStandardPermission(long permission)
          Disable a standard perrmission.
 void enableAllStandardPermissions()
          Set all standard permission flags.
 void enableExtendedPermission(ExtendedPermissionInterface perm)
          Enable an extended perrmission
 void enableExtendedPermission(ExtendedPermissionInterface[] perms)
          Enable a set of extended perrmissions.
 void enableStandardPermission(long permission)
          Enable a standard perrmission.
 boolean equals(AccessLevel level)
          Check if the specified accesslevel is equal to this AccessLevel
static java.lang.String[] getAllDefinedStandardPermissionNames(LibrarySessionInterface session)
          return the array of all defined standard permission localized labels.
static java.lang.String[] getAllDefinedStandardPermissionNames(Localizer localizer)
          return the array of all defined standard permission localized labels.
static long[] getAllDefinedStandardPermissions()
          return the array of all defined standard permission numeric values.
 java.lang.String[] getEnabledStandardPermissionNames(LibrarySessionInterface session)
          return the array of the names of all standard permission enabled in this instance.
 java.lang.String[] getEnabledStandardPermissionNames(Localizer localizer)
          return the array of the names of all standard permission enabled in this instance.
 long[] getEnabledStandardPermissions()
          return the array of all enabled standard permissions, using the numeric values (defined as static long constants in this class) to represent each permission.
 AttributeValue getExtendedPermissions()
          Get all ExtendedPermissions, as an AttributeValue of type SystemObjectArray.
 boolean isExtendedPermissionEnabled(ExtendedPermissionInterface perm)
          Is a extended permission enabled?
 boolean isStandardPermissionEnabled(long permission)
          Is a standard perrmission enabled?
 boolean isSufficientlyEnabled(AccessLevel level, LibrarySessionInterface sess)
          check to see if specified permissions are enabled on the target AccessLevel.
 void subtract(AccessLevel level, LibrarySessionInterface sess)
          Remove permissions specified in another AccessLevel to this AccessLevel.
 long toLong()
          toLong - return the long representation of the access level.
 java.lang.String toString()
          toString - convert AccessLevel to a String, representing the set of permissions; for example "{Discover,GetContent}".
 java.lang.String toString(Localizer localizer)
          toString - convert AccessLevel to a String, representing the set of permissions for a specified Localizer; for example "{Discover,GetContent}".
 

Field Detail


ACCESSLEVEL_NONE

public static final long ACCESSLEVEL_NONE
Numeric value that designates "no permissions".

ACCESSLEVEL_ALL

public static final long ACCESSLEVEL_ALL
Numeric value that designates "all permissions".

ACCESSLEVEL_DISCOVER

public static final long ACCESSLEVEL_DISCOVER
Numeric value that designates Discover permission.

ACCESSLEVEL_SET_ATTR

public static final long ACCESSLEVEL_SET_ATTR
Numeric value that designates permission to update an object attribute.

ACCESSLEVEL_GET_CONTENT

public static final long ACCESSLEVEL_GET_CONTENT
Numeric value that designates permission to get content of a Document.

ACCESSLEVEL_SET_CONTENT

public static final long ACCESSLEVEL_SET_CONTENT
Numeric value that designates permission to update content of a Document.

ACCESSLEVEL_DELETE

public static final long ACCESSLEVEL_DELETE
Numeric value that designates permission to delete, undelete or free an object.

ACCESSLEVEL_LOCK

public static final long ACCESSLEVEL_LOCK
Numeric value that designates permission to lock or unlock PublicObjects.

ACCESSLEVEL_GRANT

public static final long ACCESSLEVEL_GRANT
Numeric value that designates permission to change a Publicobject's Owner, ACL AdministrationGroup to another user

ACCESSLEVEL_CREATE

public static final long ACCESSLEVEL_CREATE
Numeric value that designates permission to create an instance of a Class.

ACCESSLEVEL_SELECTORACCESS

public static final long ACCESSLEVEL_SELECTORACCESS
Numeric value that designates permission to search a Class in a Selector or a Search.

ACCESSLEVEL_ADDMEMBER

public static final long ACCESSLEVEL_ADDMEMBER
Numeric value that designates permission to add a DirectoryObject to a DirectoryGroup.

ACCESSLEVEL_REMOVEMEMBER

public static final long ACCESSLEVEL_REMOVEMEMBER
Numeric value that designates permission to remove a DirectoryObject from a DirectoryGroup.

ACCESSLEVEL_ADDITEM

public static final long ACCESSLEVEL_ADDITEM
Numeric value that designates permission to add an item to a Folder.

ACCESSLEVEL_REMOVEITEM

public static final long ACCESSLEVEL_REMOVEITEM
Numeric value that designates permission to remove an item from a Folder.

ACCESSLEVEL_ADDRELATIONSHIP

public static final long ACCESSLEVEL_ADDRELATIONSHIP
Numeric value that designates permission to relate a PublicObject to another PublicObject.

ACCESSLEVEL_REMOVERELATIONSHIP

public static final long ACCESSLEVEL_REMOVERELATIONSHIP
Numeric value that designates permission to remove a Relationship between a PublicObject. and another PublicObject

ACCESSLEVEL_ADDVERSIONSERIES

public static final long ACCESSLEVEL_ADDVERSIONSERIES
Numeric value that designates permission to add a VersionSeries to a Family.

ACCESSLEVEL_REMOVEVERSIONSERIES

public static final long ACCESSLEVEL_REMOVEVERSIONSERIES
Numeric value that designates permission to remove a VersionSeries from a Family.

ACCESSLEVEL_ADDVERSION

public static final long ACCESSLEVEL_ADDVERSION
Numeric value that designates permission to add a new version to a VersionSeries.

ACCESSLEVEL_REMOVEVERSION

public static final long ACCESSLEVEL_REMOVEVERSION
Numeric value that designates permission to remove a version from a VersionSeries.

ACCESSLEVEL_SETDEFAULTVERSION

public static final long ACCESSLEVEL_SETDEFAULTVERSION
Numeric value that designates permission to change the default version or VersionSeries of a Family or VersionSeries.

ACCESSLEVEL_SETPOLICY

public static final long ACCESSLEVEL_SETPOLICY
Numeric value that designates permission to change the PolicyPropertyBundle associated with a PublicObject.

ACCESSLEVEL_ENQUEUE

public static final long ACCESSLEVEL_ENQUEUE
Numeric value that designates permission to enqueue messages on to a queue.

ACCESSLEVEL_DEQUEUE

public static final long ACCESSLEVEL_DEQUEUE
Numeric value that designates permission to dequeue messages from a queue.

ACCESSLEVEL_UNLOCK

public static final long ACCESSLEVEL_UNLOCK
Numeric value that designates permission to unlock PublicObjects.

ACCESSLEVEL_TOSTRING_PREFIX_KEY

public static final java.lang.String ACCESSLEVEL_TOSTRING_PREFIX_KEY
resourceBundle key used to get the prefix for a String representation for an AccessLevel. For example, if an AccessLevel that has Discover and GetContent were to be represented as {Discover,GetContent}, the prefix key lookup would return the string "{".

ACCESSLEVEL_TOSTRING_SUFFIX_KEY

public static final java.lang.String ACCESSLEVEL_TOSTRING_SUFFIX_KEY
resourceBundle key used to get the suffix for a String representation for an AccessLevel. For example, if an AccessLevel that has Discover and GetContent were to be represented as {Discover,GetContent}, the prefix key lookup would return the string "}".

ACCESSLEVEL_TOSTRING_DELIMITER_KEY

public static final java.lang.String ACCESSLEVEL_TOSTRING_DELIMITER_KEY
resourceBundle key used to get the permission delimiter for a String representation for an AccessLevel. For example, if an AccessLevel that has Discover and GetContent were to be represented as {Discover,GetContent}, the prefix key lookup would return the string ",".
Constructor Detail

AccessLevel

public AccessLevel()
            throws IfsException
default Constructor for an AccessLevel. All permission flags are initially disabled.

AccessLevel

public AccessLevel(long access_level)
Construct an AccessLevel, with a long accesslevel value.
Parameters:
access - The long access level.

AccessLevel

public AccessLevel(java.lang.String[] stringLevels)
            throws IfsException
constructor to initialize set of permissions, specified by an array of Strings. The String values correspond to the values assigned the the permission keys (defined as static Strings in this class) in the appropriate ResourceBundle, associated with the default Localizer.
Parameters:
stringLevels - - array of permission Strings.
Throws:
IfsException - if operation fails.

AccessLevel

public AccessLevel(java.lang.String[] stringLevels,
                   LibrarySessionInterface session)
            throws IfsException
constructor to initialize set of permissions, specified by an array of Strings and a specific LibrarySessionInterface. The LibrarySessionInterface is used to determine the Localizer, which is used to locally interpret the specified Strings. The String values correspond to the values assigned to the permission keys (defined as static Strings in this class) in the appropriate ResourceBundle, associated with the indirectly specified Localizer.
Parameters:
stringLevels - - array of permission Strings.
session - - LibrarySession used to determine the Localizer to be used to translate the specified Strings into standard permissions.
Throws:
IfsException - if operation fails.

AccessLevel

public AccessLevel(java.lang.String[] stringLevels,
                   Localizer localizer)
            throws IfsException
constructor to initialize set of permissions, specified by an array of Strings and a specific Localizer. The String values correspond to the values assigned to the permission keys (defined as static Strings in this class) in the appropriate ResourceBundle, associated with the specified Localizer.
Parameters:
stringLevels - - array of permission Strings.
localizer - - Localizer to be used to translate the specified Strings into standard permissions.
Throws:
IfsException - if operation fails.

AccessLevel

public AccessLevel(AccessLevel level)
            throws IfsException
Clone an AccessLevel
Throws:
IfsException - if operation fails.
Method Detail

toLong

public long toLong()
            throws IfsException
toLong - return the long representation of the access level. This only reflects the standard permissions.
Returns:
long access level

getEnabledStandardPermissions

public long[] getEnabledStandardPermissions()
                                     throws IfsException
return the array of all enabled standard permissions, using the numeric values (defined as static long constants in this class) to represent each permission.
Returns:
all enabled standard permission numeric values.
Throws:
IfsException - if operation fails.

getAllDefinedStandardPermissions

public static long[] getAllDefinedStandardPermissions()
                                               throws IfsException
return the array of all defined standard permission numeric values.
Returns:
all defined standard permission numeric values.
Throws:
IfsException - if operation fails.

getEnabledStandardPermissionNames

public java.lang.String[] getEnabledStandardPermissionNames(LibrarySessionInterface session)
                                                     throws IfsException
return the array of the names of all standard permission enabled in this instance. The names are localized using the specified LibrarySession's Localizer.
Parameters:
session - a LibrarySession, used to determine the Localizer
Returns:
the names of all standard permissions that are enabled.
Throws:
IfsException - if operation fails.

getEnabledStandardPermissionNames

public java.lang.String[] getEnabledStandardPermissionNames(Localizer localizer)
                                                     throws IfsException
return the array of the names of all standard permission enabled in this instance. The names are localized using the specified Localizer.
Parameters:
localizer - Localizer used to get the localized Permission names.
Returns:
the names of all standard permissions that are enabled.
Throws:
IfsException - if operation fails.

getAllDefinedStandardPermissionNames

public static java.lang.String[] getAllDefinedStandardPermissionNames(LibrarySessionInterface session)
                                                               throws IfsException
return the array of all defined standard permission localized labels.
Parameters:
session - a LibrarySession, used to determine the Localizer
Returns:
all defined standard permission String values.
Throws:
IfsException - if operation fails.

getAllDefinedStandardPermissionNames

public static java.lang.String[] getAllDefinedStandardPermissionNames(Localizer localizer)
                                                               throws IfsException
return the array of all defined standard permission localized labels.
Parameters:
session - a Localizer, used to returned localized String values. If null, the default Localizer is used.
Returns:
all defined standard permission String values.
Throws:
IfsException - if operation fails.

add

public void add(AccessLevel level,
                LibrarySessionInterface sess)
         throws IfsException
Add permissions specified in another AccessLevel to this AccessLevel
Parameters:
level - AccessLevel to add (union) to this instance.
sess - the Session.

subtract

public void subtract(AccessLevel level,
                     LibrarySessionInterface sess)
              throws IfsException
Remove permissions specified in another AccessLevel to this AccessLevel.
Parameters:
level - AccessLevel to remove (union) from this instance.
sess - the Session.

equals

public boolean equals(AccessLevel level)
               throws IfsException
Check if the specified accesslevel is equal to this AccessLevel
Parameters:
level - AccessLevel to compare to this instance.
sess - the Session.
Returns:
true if the specified level is the same

isSufficientlyEnabled

public boolean isSufficientlyEnabled(AccessLevel level,
                                     LibrarySessionInterface sess)
                              throws IfsException
check to see if specified permissions are enabled on the target AccessLevel.
Parameters:
level - AccessLevel that holds permissions to check.
sess - the Session.
Returns:
true if target object has at least the permissions specified.

enableAllStandardPermissions

public void enableAllStandardPermissions()
                                  throws IfsException
Set all standard permission flags.

clearAllStandardPermissions

public void clearAllStandardPermissions()
                                 throws IfsException
Clear all standard permission flags.

clearAllExtendedPermissions

public void clearAllExtendedPermissions()
Clear all extended permission flags.

clearAllPermissions

public void clearAllPermissions()
                         throws IfsException
Clear all permission flags - standard and extended.
Throws:
IfsException - if operation fails.

enableStandardPermission

public void enableStandardPermission(long permission)
                              throws IfsException
Enable a standard perrmission.
Parameters:
permission - the standard permission to enable.
Throws:
IfsException - if operation fails.

disableStandardPermission

public void disableStandardPermission(long permission)
                               throws IfsException
Disable a standard perrmission.
Parameters:
permission - the standard permission to disable.
Throws:
IfsException - if operation fails.

isStandardPermissionEnabled

public boolean isStandardPermissionEnabled(long permission)
                                    throws IfsException
Is a standard perrmission enabled?
Parameters:
permission - the standard permission to check.
Returns:
boolean true if the specified permission is enabled.
Throws:
IfsException - if operation fails.

enableExtendedPermission

public void enableExtendedPermission(ExtendedPermissionInterface perm)
                              throws IfsException
Enable an extended perrmission
Parameters:
perm - ExtendedPermission to enable.
Throws:
IfsException - if operation fails.

enableExtendedPermission

public void enableExtendedPermission(ExtendedPermissionInterface[] perms)
                              throws IfsException
Enable a set of extended perrmissions.
Parameters:
perms - ExtendedPermissions to enable.
Throws:
IfsException - if operation fails.

disableExtendedPermission

public void disableExtendedPermission(ExtendedPermissionInterface perm)
                               throws IfsException
Disable an extended perrmission.
Parameters:
perm - ExtendedPermission to disable.
Throws:
IfsException - if operation fails.

disableExtendedPermission

public void disableExtendedPermission(ExtendedPermissionInterface[] perms)
                               throws IfsException
Disable a set of extended perrmissions.
Parameters:
perms - array of ExtendedPermissions to disable.
Throws:
IfsException - if operation fails.

isExtendedPermissionEnabled

public boolean isExtendedPermissionEnabled(ExtendedPermissionInterface perm)
                                    throws IfsException
Is a extended permission enabled?
Parameters:
perm - ExtendedPermission to check.
Returns:
boolean true if specified ExtendedPermission is enabled.
Throws:
IfsException - if operation fails.

getExtendedPermissions

public AttributeValue getExtendedPermissions()
                                      throws IfsException
Get all ExtendedPermissions, as an AttributeValue of type SystemObjectArray. Coder beware that the array may contain null elements due to obsoleted extended permissions.
Returns:
AttributeValue of type SystemObjectArray that holds the array of ExtendedPermissions enabled on this AccessLevel.
Throws:
IfsException - if operation fails.

toString

public java.lang.String toString()
toString - convert AccessLevel to a String, representing the set of permissions; for example "{Discover,GetContent}". This string is constructed using the IFS.REPOS.ACCESSLEVEL.TOSTRING_PREFIX, IFS.REPOS.ACCESSLEVEL.TOSTRING_SUFFIX, IFS.REPOS.ACCESSLEVEL.TOSTRING_DELIMITER, and the specific permission keys (e.g. ACCESSLEVEL_GET_CONTENT_KEY); and the translations for these provided in the ResourceBundles.
Overrides:
toString in class java.lang.Object
Returns:
the String representation of the AccessLevel

toString

public java.lang.String toString(Localizer localizer)
                          throws IfsException
toString - convert AccessLevel to a String, representing the set of permissions for a specified Localizer; for example "{Discover,GetContent}". This string is constructed using the ACCESSLEVEL_TOSTRING_PREFIX_KEY, ACCESSLEVEL_TOSTRING_SUFFIX_KEY, ACCESSLEVEL_TOSTRING_DELIMITER_KEY, and the specific permission keys (e.g. ACCESSLEVEL_GET_CONTENT_KEY); and the translations for these provided inthe ResourceBundles.
Returns:
the String representation of the AccessLevel
Throws:
IfsException - if operation fails.

Oracle Content Management SDK

(c) 2002 Copyright Oracle Corporation. All rights reserved.