Skip to content

Commit

Permalink
Merge pull request #386 from Yasasr1/add-forbidden
Browse files Browse the repository at this point in the history
Handle forbidden responses when updating roles with a patch request
  • Loading branch information
Yasasr1 authored Jul 10, 2023
2 parents 008515f + 5aa8cf6 commit e7545fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit e7545fe

Please sign in to comment.