fix removing groups from space

This commit is contained in:
Roman Perekhod
2024-04-08 21:53:21 +02:00
committed by Ralf Haferkamp
parent 48617779fc
commit 38f9698973
2 changed files with 17 additions and 6 deletions

View File

@@ -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

View File

@@ -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"
@@ -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
}