add comment for mapping roles
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -497,11 +497,15 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa
|
|||||||
// will have the same id.
|
// will have the same id.
|
||||||
tmp := id
|
tmp := id
|
||||||
identity := libregraph.IdentitySet{User: &libregraph.Identity{Id: &tmp}}
|
identity := libregraph.IdentitySet{User: &libregraph.Identity{Id: &tmp}}
|
||||||
|
// we need to map the permissions to the roles
|
||||||
switch {
|
switch {
|
||||||
|
// having RemoveGrant qualifies you as a manager
|
||||||
case perm.RemoveGrant:
|
case perm.RemoveGrant:
|
||||||
managerIdentities = append(managerIdentities, identity)
|
managerIdentities = append(managerIdentities, identity)
|
||||||
|
// InitiateFileUpload means you are an editor
|
||||||
case perm.InitiateFileUpload:
|
case perm.InitiateFileUpload:
|
||||||
editorIdentities = append(editorIdentities, identity)
|
editorIdentities = append(editorIdentities, identity)
|
||||||
|
// Stat permission at least makes you a viewer
|
||||||
case perm.Stat:
|
case perm.Stat:
|
||||||
viewerIdentities = append(viewerIdentities, identity)
|
viewerIdentities = append(viewerIdentities, identity)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user