Skip to content

Commit

Permalink
graph: User CS3 helper to check ResourceIDs for equality
Browse files Browse the repository at this point in the history
  • Loading branch information
rhafer committed Nov 30, 2023
1 parent 3261a3b commit 2cbb62e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions services/graph/pkg/service/v0/driveitems.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,7 @@ func (g Graph) DeletePermission(w http.ResponseWriter, r *http.Request) {

// The resourceID of the shared resource need to match the item ID from the Request Path
// otherwise this is an invalid Request.
if sharedResourceId.GetStorageId() != itemID.GetStorageId() ||
sharedResourceId.GetSpaceId() != itemID.GetSpaceId() ||
sharedResourceId.GetOpaqueId() != itemID.GetOpaqueId() {
if !utils.ResourceIDEqual(sharedResourceId, &itemID) {
g.logger.Debug().Msg("resourceID of shared does not match itemID")
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, "permissionID and itemID do not match")
return
Expand Down

0 comments on commit 2cbb62e

Please sign in to comment.