@Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { Set<String> standardRoles = authorizerConfiguration.getStandardRoles(); String specifiedRole = value.asString(); for (String current : standardRoles) { @Override public ModelNode correct(ModelNode newValue, ModelNode currentValue) { Set<String> standardRoles = authorizerConfiguration.getStandardRoles(); String specifiedRole = newValue.asString();
@Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { Set<String> standardRoles = authorizerConfiguration.getStandardRoles(); String specifiedRole = value.asString(); for (String current : standardRoles) { @Override public ModelNode correct(ModelNode newValue, ModelNode currentValue) { Set<String> standardRoles = authorizerConfiguration.getStandardRoles(); String specifiedRole = newValue.asString();
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Resource resource = context.createResource(PathAddress.EMPTY_ADDRESS); PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String roleName = address.getLastElement().getValue(); if (authorizerConfiguration.getStandardRoles().contains(roleName) == false) { if (domainMode) { ScopedRoleRequiredHandler.addOperation(context, roleName); } else { // Standalone mode so no scoped roles so if it is not a standard role it is invalid. throw DomainManagementLogger.ROOT_LOGGER.invalidRoleName(roleName); } } ModelNode model = resource.getModel(); RoleMappingResourceDefinition.INCLUDE_ALL.validateAndSet(operation, model); registerRuntimeAdd(context, roleName.toUpperCase(Locale.ENGLISH)); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Resource resource = context.createResource(PathAddress.EMPTY_ADDRESS); PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String roleName = address.getLastElement().getValue(); if (authorizerConfiguration.getStandardRoles().contains(roleName) == false) { if (domainMode) { ScopedRoleRequiredHandler.addOperation(context, roleName); } else { // Standalone mode so no scoped roles so if it is not a standard role it is invalid. throw DomainManagementLogger.ROOT_LOGGER.invalidRoleName(roleName); } } ModelNode model = resource.getModel(); RoleMappingResourceDefinition.INCLUDE_ALL.validateAndSet(operation, model); registerRuntimeAdd(context, roleName.toUpperCase(Locale.ENGLISH)); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final PathElement lastElement = address.getLastElement(); final String roleName = lastElement.getValue(); Set<String> standardRoles = authorizerConfiguration.getStandardRoles(); for (String current : standardRoles) { if (roleName.equalsIgnoreCase(current)) { throw DomainManagementLogger.ROOT_LOGGER.scopedRoleStandardName(roleName, current); } } Resource readResource = context.readResourceFromRoot(AUTHZ_ADDRESS, false); Set<String> hostScopedRoles = readResource.getChildrenNames(HOST_SCOPED_ROLE); for (String current : hostScopedRoles) { if (roleName.equalsIgnoreCase(current)) { throw DomainManagementLogger.ROOT_LOGGER.duplicateScopedRole(HOST_SCOPED_ROLE, roleName); } } Set<String> serverGroupScopedRoles = readResource.getChildrenNames(SERVER_GROUP_SCOPED_ROLE); for (String current : serverGroupScopedRoles) { if (roleName.equalsIgnoreCase(current)) { throw DomainManagementLogger.ROOT_LOGGER.duplicateScopedRole(SERVER_GROUP_SCOPED_ROLE, roleName); } } super.execute(context, operation); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final PathElement lastElement = address.getLastElement(); final String roleName = lastElement.getValue(); Set<String> standardRoles = authorizerConfiguration.getStandardRoles(); for (String current : standardRoles) { if (roleName.equalsIgnoreCase(current)) { throw DomainManagementLogger.ROOT_LOGGER.scopedRoleStandardName(roleName, current); } } Resource readResource = context.readResourceFromRoot(AUTHZ_ADDRESS, false); Set<String> hostScopedRoles = readResource.getChildrenNames(HOST_SCOPED_ROLE); for (String current : hostScopedRoles) { if (roleName.equalsIgnoreCase(current)) { throw DomainManagementLogger.ROOT_LOGGER.duplicateScopedRole(HOST_SCOPED_ROLE, roleName); } } Set<String> serverGroupScopedRoles = readResource.getChildrenNames(SERVER_GROUP_SCOPED_ROLE); for (String current : serverGroupScopedRoles) { if (roleName.equalsIgnoreCase(current)) { throw DomainManagementLogger.ROOT_LOGGER.duplicateScopedRole(SERVER_GROUP_SCOPED_ROLE, roleName); } } super.execute(context, operation); }