Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle forbidden responses when updating roles with a patch request #385

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.wso2.charon3.core.exceptions.BadRequestException;
import org.wso2.charon3.core.exceptions.CharonException;
import org.wso2.charon3.core.exceptions.ConflictException;
import org.wso2.charon3.core.exceptions.ForbiddenException;
import org.wso2.charon3.core.exceptions.NotFoundException;
import org.wso2.charon3.core.exceptions.NotImplementedException;
import org.wso2.charon3.core.objects.Role;
Expand Down Expand Up @@ -129,7 +130,8 @@ RolesGetResponse listRolesWithPost(SearchRequest searchRequest)
* @throws NotImplementedException Functionality no implemented exception.
*/
default Role patchRole(String roleId, Map<String, List<PatchOperation>> patchOperations)
throws NotImplementedException, BadRequestException, CharonException, ConflictException, NotFoundException {
throws NotImplementedException, BadRequestException, CharonException, ConflictException, NotFoundException,
ForbiddenException {

throw new NotImplementedException("patchRole method is not implemented");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.wso2.charon3.core.exceptions.BadRequestException;
import org.wso2.charon3.core.exceptions.CharonException;
import org.wso2.charon3.core.exceptions.ConflictException;
import org.wso2.charon3.core.exceptions.ForbiddenException;
import org.wso2.charon3.core.exceptions.InternalErrorException;
import org.wso2.charon3.core.exceptions.NotFoundException;
import org.wso2.charon3.core.exceptions.NotImplementedException;
Expand Down Expand Up @@ -613,7 +614,7 @@ private SCIMResponse updateWithPatchOperations(String existingRoleId, List<Patch
Role updatedRole = roleManager.patchRole(existingRoleId, patchOperations);
return getScimResponse(encoder, updatedRole);
} catch (NotFoundException | BadRequestException | NotImplementedException | ConflictException |
CharonException | InternalErrorException e) {
CharonException | InternalErrorException | ForbiddenException e) {
return AbstractResourceManager.encodeSCIMException(e);
}
}
Expand Down