mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-08 13:19:58 -06:00
Merge pull request #10510 from rhafer/issue/10488
fix(graph/ocm): Fix ocm share creation when user is in cache
This commit is contained in:
@@ -168,11 +168,9 @@ func (s DriveItemPermissionsService) Invite(ctx context.Context, resourceId *sto
|
||||
shareid = createShareResponse.GetShare().GetId().GetOpaqueId()
|
||||
expiration = createShareResponse.GetShare().GetExpiration()
|
||||
default:
|
||||
federated := false
|
||||
user, err := s.identityCache.GetUser(ctx, objectID)
|
||||
if errors.Is(err, identity.ErrNotFound) && s.config.IncludeOCMSharees {
|
||||
user, err = s.identityCache.GetAcceptedUser(ctx, objectID)
|
||||
federated = true
|
||||
if err == nil && IsSpaceRoot(statResponse.GetInfo().GetId()) {
|
||||
return libregraph.Permission{}, errorcode.New(errorcode.InvalidRequest, "federated user can not become a space member")
|
||||
}
|
||||
@@ -189,7 +187,7 @@ func (s DriveItemPermissionsService) Invite(ctx context.Context, resourceId *sto
|
||||
},
|
||||
}
|
||||
|
||||
if federated {
|
||||
if user.GetUserType() == identity.UserTypeFederated {
|
||||
if len(user.Identities) < 1 {
|
||||
return libregraph.Permission{}, errorcode.New(errorcode.InvalidRequest, "user has no federated identity")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user