Class AccessControlServerHelper
- All Implemented Interfaces:
Externalizable,Serializable
AccessControlManagerSvr interface.
Supported API: true
Extendable: false
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDisables auditing of theNotAuthorizedException.static booleanReturns true if auditing of theNotAuthorizedExceptionis enabled, otherwise returns false.static voidRe-enables auditing of theNotAuthorizedException.
-
Field Details
-
manager
Supported API: true
-
-
Method Details
-
disableNotAuthorizedAudit
public static void disableNotAuthorizedAudit()Disables auditing of theNotAuthorizedException. AMethodContextattribute is incremented to indicate that the exception should not be audited. When the attribute has a nonzero value, auditing is disabled.This method is to be used when the
NotAuthorizedExceptiondoes not result in a user's action failing due to the lack of access rights. For example, if the details page for a document includes information about its owner, and theaccessResource.SECURED_INFORMATIONmessage is displayed instead of the owner information when an attempt to access the owner results in aNotAuthorizedException, auditing should be disabled while attempting to get the owner information. Auditing must be re-enabled after the access attempt is complete. Uses of this API should be minimal. Consider calling one of theAccessControlManageraccess checking methods such as ahasAccessmethod and checking the result rather than catching aNotAuthorizedException.Code example:
AccessControlServerHelper.disableNotAuthorizedAudit(); try { // Perform an operation that may throw a NotAuthorizedException // nested in a WTRuntimeException ... } catch (WTRuntimeException wtre) { if (wtre.getNestedThrowable() instanceof NotAuthorizedException) { // Handle the authorization error that should not result in // the user's action failing } else { throw wtre; } } finally { AccessControlServerHelper.reenableNotAuthorizedAudit(); }
Supported API: true -
isNotAuthorizedAuditEnabled
public static boolean isNotAuthorizedAuditEnabled()Returns true if auditing of theNotAuthorizedExceptionis enabled, otherwise returns false.
Supported API: true- Returns:
- boolean
- See Also:
-
reenableNotAuthorizedAudit
public static void reenableNotAuthorizedAudit()Re-enables auditing of theNotAuthorizedException. The value of theMethodContextattribute that keeps track of the count of nested callers that have disabled auditing of exceptions is decremented. If the attribute's value goes to zero, auditing of exceptions is reenabled.
Supported API: true
-