/** * Removes a security role. * * @param roleId Id of the role to be removed. */ @Override @DELETE @ResourceMethodSignature(pathParams = {@PathParam("roleId")}) public void delete(Context context, Request request, Response response) throws ResourceException { try { AuthorizationManager authzManager = getSecuritySystem().getAuthorizationManager(ROLE_SOURCE); authzManager.deleteRole(getRoleId(request)); } catch (NoSuchRoleException e) { throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, e.getMessage()); } catch (NoSuchAuthorizationManagerException e) { this.getLogger().warn("Could not found AuthorizationManager: " + ROLE_SOURCE, e); // we should not ever get here throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, "Authorization Manager for: " + ROLE_SOURCE + " could not be found."); } }
/** * Removes a security role. * * @param roleId Id of the role to be removed. */ @Override @DELETE @ResourceMethodSignature( pathParams = { @PathParam( "roleId" ) } ) public void delete( Context context, Request request, Response response ) throws ResourceException { try { AuthorizationManager authzManager = getSecuritySystem().getAuthorizationManager( ROLE_SOURCE ); authzManager.deleteRole( getRoleId( request ) ); } catch ( NoSuchRoleException e ) { throw new ResourceException( Status.CLIENT_ERROR_NOT_FOUND, e.getMessage() ); } catch ( NoSuchAuthorizationManagerException e ) { this.getLogger().warn( "Could not found AuthorizationManager: " + ROLE_SOURCE, e ); // we should not ever get here throw new ResourceException( Status.CLIENT_ERROR_BAD_REQUEST, "Authorization Manager for: " + ROLE_SOURCE + " could not be found." ); } }