THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
/** * Check if the caller is authorized to perform the given ACL operation on at least one * resource satisfyingof the given filtertype. * * @param requestContext Request context including request typeresourceType, security protocol, and listener name * @param op The ACL operation to check * @param fresourceType The resource filtertype * @return Return {@link trueAuthorizationResult#ALLOWED} if the caller is authorized to perform the giventhe ACL operation * * given ACL operation on at least one resource satisfyingof the given filter. Return falsetype. * Return {@link AuthorizationResult#DENIED} otherwise. */ default AuthorizationResult authorizeAny(AuthorizableRequestContext requestContext, AclOperation op, ResourcePatternFilter f) { ResourcePatternFilter resourceFilter = new ResourcePatternFilter(type, null, PatternType.ANY); AclBindingFilter aclFilter = new AclBindingFilter( resourceFilter, new AccessControlEntryFilter( requestContext.principal().toString(), requestContext.clientAddress().getHostAddress(), op, AclPermissionType.ANY)); for (AclBinding binding : acls(aclFilter)) { if (binding.entry().permissionType() != AclPermissionType.ALLOW) continue; List<Action> action = Collections.singletonList(new Action( op, binding.pattern(), 1, false, false)); if (authorize(requestContext, action).get(0) == AuthorizationResult.ALLOWED) { return AuthorizationResult.ALLOWED; } } return AuthorizationResult.DENIED; } |
...