Skip to content

Commit

Permalink
Merge pull request #10219 from kobergj/FixDeleteSharePanic
Browse files Browse the repository at this point in the history
Fix panic when deleting ocm shares
  • Loading branch information
2403905 authored Oct 2, 2024
2 parents 99e8082 + 6e7bafb commit d8a641f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-delete-share-panic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix delete share panic

Fixes a panic when deleting an ocm share

https://github.com/owncloud/ocis/pull/10219
6 changes: 3 additions & 3 deletions services/graph/pkg/service/v0/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,10 @@ func roleConditionForResourceType(ri *storageprovider.ResourceInfo) (string, err
}

func federatedRoleConditionForResourceType(ri *storageprovider.ResourceInfo) (string, error) {
switch {
case ri.Type == storageprovider.ResourceType_RESOURCE_TYPE_CONTAINER:
switch ri.GetType() {
case storageprovider.ResourceType_RESOURCE_TYPE_CONTAINER:
return unifiedrole.UnifiedRoleConditionFolderFederatedUser, nil
case ri.Type == storageprovider.ResourceType_RESOURCE_TYPE_FILE:
case storageprovider.ResourceType_RESOURCE_TYPE_FILE:
return unifiedrole.UnifiedRoleConditionFileFederatedUser, nil
default:
return "", errorcode.New(errorcode.InvalidRequest, "unsupported resource type for federated role")
Expand Down

0 comments on commit d8a641f

Please sign in to comment.