Package org.camunda.bpm.engine
Class AuthorizationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.camunda.bpm.engine.ProcessEngineException
-
- org.camunda.bpm.engine.AuthorizationException
-
- All Implemented Interfaces:
Serializable
public class AuthorizationException extends ProcessEngineException
Exception thrown by the process engine in case a user tries to interact with a resource in an unauthorized way.
The exception contains a list of Missing authorizations. The List is a disjunction i.e. a user should have any of the authorization for the engine to continue the execution beyond the point where it failed.
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<MissingAuthorization>missingAuthorizationsprotected StringpermissionNameDeprecated.protected StringresourceIdDeprecated.protected StringresourceTypeDeprecated.protected StringuserId-
Fields inherited from class org.camunda.bpm.engine.ProcessEngineException
code
-
-
Constructor Summary
Constructors Constructor Description AuthorizationException(String message)AuthorizationException(String userId, String permissionName, String resourceType, String resourceId)AuthorizationException(String userId, List<MissingAuthorization> info)AuthorizationException(String userId, MissingAuthorization exceptionInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static StringgenerateMissingAuthorizationsList(List<MissingAuthorization> missingAuthorizations)Generate a String containing a list of missing authorizations.List<MissingAuthorization>getMissingAuthorizations()StringgetResourceId()Deprecated.UsegetMissingAuthorizations()to get the id of the resource of theMissingAuthorization(s).StringgetResourceType()Deprecated.UsegetMissingAuthorizations()to get the type of the resource of theMissingAuthorization(s).StringgetUserId()StringgetViolatedPermissionName()Deprecated.UsegetMissingAuthorizations()to get the violated permission name of theMissingAuthorization(s).-
Methods inherited from class org.camunda.bpm.engine.ProcessEngineException
getCode, setCode
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
userId
protected final String userId
-
missingAuthorizations
protected final List<MissingAuthorization> missingAuthorizations
-
resourceType
@Deprecated protected String resourceType
Deprecated.
-
permissionName
@Deprecated protected String permissionName
Deprecated.
-
resourceId
@Deprecated protected String resourceId
Deprecated.
-
-
Constructor Detail
-
AuthorizationException
public AuthorizationException(String message)
-
AuthorizationException
public AuthorizationException(String userId, String permissionName, String resourceType, String resourceId)
-
AuthorizationException
public AuthorizationException(String userId, MissingAuthorization exceptionInfo)
-
AuthorizationException
public AuthorizationException(String userId, List<MissingAuthorization> info)
-
-
Method Detail
-
getResourceType
@Deprecated public String getResourceType()
Deprecated.UsegetMissingAuthorizations()to get the type of the resource of theMissingAuthorization(s). This method may be removed in future versions.- Returns:
- the type of the resource if there
is only one
MissingAuthorization,nullotherwise
-
getViolatedPermissionName
@Deprecated public String getViolatedPermissionName()
Deprecated.UsegetMissingAuthorizations()to get the violated permission name of theMissingAuthorization(s). This method may be removed in future versions.- Returns:
- the type of the violated permission name if there
is only one
MissingAuthorization,nullotherwise
-
getUserId
public String getUserId()
- Returns:
- id of the user in which context the request was made and who misses authorizations to perform it successfully
-
getResourceId
@Deprecated public String getResourceId()
Deprecated.UsegetMissingAuthorizations()to get the id of the resource of theMissingAuthorization(s). This method may be removed in future versions.- Returns:
- the id of the resource if there
is only one
MissingAuthorization,nullotherwise
-
getMissingAuthorizations
public List<MissingAuthorization> getMissingAuthorizations()
- Returns:
- Disjunctive list of
MissingAuthorizationfrom which a user needs to have at least one for the authorization to pass
-
generateMissingAuthorizationsList
public static String generateMissingAuthorizationsList(List<MissingAuthorization> missingAuthorizations)
Generate a String containing a list of missing authorizations.- Parameters:
missingAuthorizations-
-
-