class AssertionRequirement
cangjie
public class AssertionRequirement <: IAuthorizationHandler & IAuthorizationRequirement1
功能:表示基于断言委托的授权要求。
父类型:
成员概览
| 成员 | 功能 |
|---|---|
| init((AuthorizationHandlerContext) -> Bool) | 创建一个断言授权要求。 |
| prop handler | 获取授权断言委托。 |
| func handle(AuthorizationHandlerContext) | 根据断言结果处理授权要求。 |
| func toString() | 返回当前授权要求的描述字符串。 |
init((AuthorizationHandlerContext) -> Bool)
cangjie
public init(handler: (AuthorizationHandlerContext) -> Bool)1
功能:创建一个断言授权要求。
参数:
- handler: (AuthorizationHandlerContext) -> Bool - 用于判断授权是否成功的断言委托。
prop handler
cangjie
public prop handler: (AuthorizationHandlerContext) -> Bool1
功能:获取授权断言委托。
类型:(AuthorizationHandlerContext) -> Bool
func handle(AuthorizationHandlerContext)
cangjie
public func handle(context: AuthorizationHandlerContext): Unit1
功能:根据断言结果处理授权要求。
参数:
- context: AuthorizationHandlerContext - 当前授权处理上下文。
返回值:
Unit
func toString()
cangjie
public func toString(): String1
功能:返回当前授权要求的描述字符串。
返回值:
String- 当前授权要求的描述字符串。