Class AuthorizationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
tech.riemann.nif.auth.AuthorizationException
- All Implemented Interfaces:
Serializable
鉴权异常(权限不足异常)
当用户已通过身份验证但没有足够的权限访问资源时抛出此异常,例如: 1. 用户没有所需的角色 2. 用户没有所需的权限 3. 用户尝试访问被保护的资源
与AuthenticationException的区别: - AuthenticationException:身份验证失败(用户未登录或凭证无效) - AuthorizationException:权限验证失败(用户已登录但权限不足)
- Author:
- Kerbores(kerbores@riemann.tech)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescription构造默认的权限验证异常AuthorizationException(String message) 构造带消息的权限验证异常AuthorizationException(String message, String status) 构造带消息和状态码的权限验证异常 -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AuthorizationException
public AuthorizationException()构造默认的权限验证异常使用默认状态码"DEFAULT"
-
AuthorizationException
构造带消息的权限验证异常使用默认状态码"DEFAULT"
- Parameters:
message- 异常消息,描述权限验证失败的原因
-
AuthorizationException
-
-
Method Details
-
getStatus
-