org.kuali.rice.kns.exception
Class AuthorizationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.kuali.rice.kns.exception.KualiException
                  extended by org.kuali.rice.kns.exception.AuthorizationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DocumentAuthorizationException, DocumentTypeAuthorizationException

public class AuthorizationException
extends KualiException

This class represents an exception that is thrown when a given user is not authorized to take the given action on the given target type.

See Also:
Serialized Form

Field Summary
protected  String action
           
protected  Map<String,Object> additionalDetails
           
private static long serialVersionUID
           
protected  String targetType
           
protected  String userId
           
 
Constructor Summary
AuthorizationException(String userId, String action, String targetType)
           
AuthorizationException(String userId, String action, String targetType, Map<String,Object> additionalDetails)
          Constructs a exception with a message from the passed in information.
AuthorizationException(String userId, String action, String targetType, String message, Map<String,Object> additionalDetails)
          allows you to construct the exception message manually.
 
Method Summary
 String getAction()
           
 Map<String,Object> getAdditionalDetails()
           
 String getErrorMessageKey()
           
 String getTargetType()
           
 String getUserId()
           
 
Methods inherited from class org.kuali.rice.kns.exception.KualiException
isHideIncidentReport, setHideIncidentReport
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

userId

protected final String userId

action

protected final String action

targetType

protected final String targetType

additionalDetails

protected final Map<String,Object> additionalDetails
Constructor Detail

AuthorizationException

public AuthorizationException(String userId,
                              String action,
                              String targetType)

AuthorizationException

public AuthorizationException(String userId,
                              String action,
                              String targetType,
                              Map<String,Object> additionalDetails)
Constructs a exception with a message from the passed in information.

Parameters:
userId - the userid of the user who failed authorization
action - the action the user was trying to take
targetType - what the user was trying to take action on
additionalDetails - additional details about the authorization failure to be passed in and added to the exception message (ex: permission name, qualifiers, etc.)

AuthorizationException

public AuthorizationException(String userId,
                              String action,
                              String targetType,
                              String message,
                              Map<String,Object> additionalDetails)
allows you to construct the exception message manually.

Method Detail

getAdditionalDetails

public Map<String,Object> getAdditionalDetails()

getUserId

public String getUserId()

getAction

public String getAction()

getTargetType

public String getTargetType()

getErrorMessageKey

public String getErrorMessageKey()
Returns:
message key used by Struts to select the error message to be displayed


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.