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

fix removing groups from space #8805

Merged
merged 1 commit into from
Apr 9, 2024
Merged
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
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-remove-group-from-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fix removing groups from space

We fixed a bug when unable to remove groups from space via graph

https://github.com/owncloud/ocis/pull/8803
https://github.com/owncloud/ocis/issues/8768
17 changes: 11 additions & 6 deletions services/graph/pkg/service/v0/driveitems.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"time"

gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
grouppb "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1"
userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
cs3rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
storageprovider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
Expand Down Expand Up @@ -359,17 +360,21 @@ func spacePermissionIdToCS3Grantee(permissionID string) (storageprovider.Grantee
switch parts[0] {
case "u":
grantee.Type = storageprovider.GranteeType_GRANTEE_TYPE_USER
grantee.Id = &storageprovider.Grantee_UserId{
UserId: &userpb.UserId{
OpaqueId: parts[1],
},
}
case "g":
grantee.Type = storageprovider.GranteeType_GRANTEE_TYPE_GROUP
grantee.Id = &storageprovider.Grantee_GroupId{
GroupId: &grouppb.GroupId{
OpaqueId: parts[1],
},
}
default:
return grantee, errorcode.New(errorcode.InvalidRequest, "invalid space permission id")
}

grantee.Id = &storageprovider.Grantee_UserId{
UserId: &userpb.UserId{
OpaqueId: parts[1],
},
}
return grantee, nil
}

Expand Down