run is a helper function that takes a context and a PermissionCheckRequest, and returns a CheckFunction. The returned CheckFunction, when called with a context, executes the Run method of the CheckEngine with the given request, and returns the resulting PermissionCheckResponse and error.
(request *base.PermissionCheckRequest)
| 99 | // a context, executes the Run method of the CheckEngine with the given |
| 100 | // request, and returns the resulting PermissionCheckResponse and error. |
| 101 | func (engine *CheckEngine) invoke(request *base.PermissionCheckRequest) CheckFunction { |
| 102 | return func(ctx context.Context) (*base.PermissionCheckResponse, error) { |
| 103 | return engine.invoker.Check(ctx, request) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // check constructs a CheckFunction that performs permission checks based on the type of reference in the entity definition. |
| 108 | func (engine *CheckEngine) check( |
no test coverage detected