/** * Query the configured IAuthorizer for the set of all permissions granted on JMXResources to a specific subject * @param subject * @return All permissions granted to the specfied subject (including those transitively inherited from * any roles the subject has been granted), filtered to include only permissions granted on * JMXResources */ private static Set<PermissionDetails> loadPermissions(RoleResource subject) { // get all permissions for the specified subject. We'll cache them as it's likely // we'll receive multiple lookups for the same subject (but for different resources // and permissions) in quick succession return DatabaseDescriptor.getAuthorizer().list(AuthenticatedUser.SYSTEM_USER, Permission.ALL, null, subject) .stream() .filter(details -> details.resource instanceof JMXResource) .collect(Collectors.toSet()); }
/** * Query the configured IAuthorizer for the set of all permissions granted on JMXResources to a specific subject * @param subject * @return All permissions granted to the specfied subject (including those transitively inherited from * any roles the subject has been granted), filtered to include only permissions granted on * JMXResources */ private static Set<PermissionDetails> loadPermissions(RoleResource subject) { // get all permissions for the specified subject. We'll cache them as it's likely // we'll receive multiple lookups for the same subject (but for different resources // and permissions) in quick succession return DatabaseDescriptor.getAuthorizer().list(AuthenticatedUser.SYSTEM_USER, Permission.ALL, null, subject) .stream() .filter(details -> details.resource instanceof JMXResource) .collect(Collectors.toSet()); }
/** * Query the configured IAuthorizer for the set of all permissions granted on JMXResources to a specific subject * @param subject * @return All permissions granted to the specfied subject (including those transitively inherited from * any roles the subject has been granted), filtered to include only permissions granted on * JMXResources */ private static Set<PermissionDetails> loadPermissions(RoleResource subject) { // get all permissions for the specified subject. We'll cache them as it's likely // we'll receive multiple lookups for the same subject (but for different resources // and permissions) in quick succession return DatabaseDescriptor.getAuthorizer().list(AuthenticatedUser.SYSTEM_USER, Permission.ALL, null, subject) .stream() .filter(details -> details.resource instanceof JMXResource) .collect(Collectors.toSet()); }
private Set<PermissionDetails> list(ClientState state, IResource resource) throws RequestValidationException, RequestExecutionException { return DatabaseDescriptor.getAuthorizer().list(state.getUser(), permissions, resource, username); } }
private Set<PermissionDetails> list(ClientState state, IResource resource) throws RequestValidationException, RequestExecutionException { try { return DatabaseDescriptor.getAuthorizer().list(state.getUser(), permissions, resource, grantee); } catch (UnsupportedOperationException e) { throw new InvalidRequestException(e.getMessage()); } }
private Set<PermissionDetails> list(ClientState state, IResource resource) throws RequestValidationException, RequestExecutionException { try { return DatabaseDescriptor.getAuthorizer().list(state.getUser(), permissions, resource, grantee); } catch (UnsupportedOperationException e) { throw new InvalidRequestException(e.getMessage()); } }
private Set<PermissionDetails> list(ClientState state, IResource resource) throws RequestValidationException, RequestExecutionException { try { return DatabaseDescriptor.getAuthorizer().list(state.getUser(), permissions, resource, grantee); } catch (UnsupportedOperationException e) { throw new InvalidRequestException(e.getMessage()); } }