From 9bceb71ed2f190b20743d55af7607ba582fa30ab Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Thu, 16 Sep 2021 14:18:01 +0200 Subject: [PATCH] Use Folder Get Function for Permissions --- helper/share.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helper/share.go b/helper/share.go index 3294cea..4365f4c 100644 --- a/helper/share.go +++ b/helper/share.go @@ -126,12 +126,14 @@ func ShareFolderWithUsersAndGroups(ctx context.Context, c *api.Client, folderID // ShareFolder Shares a Folder as Specified in the Passed ShareOperation Struct Slice. // Note Resources Permissions in the Folder are not Adjusted func ShareFolder(ctx context.Context, c *api.Client, folderID string, changes []ShareOperation) error { - oldPermissions, err := c.GetFolderPermissions(ctx, folderID) + oldFolder, err := c.GetFolder(ctx, folderID, &api.GetFolderOptions{ + ContainPermissions: true, + }) if err != nil { return fmt.Errorf("Getting Folder Permissions: %w", err) } - permissionChanges, err := GeneratePermissionChanges(oldPermissions, changes) + permissionChanges, err := GeneratePermissionChanges(oldFolder.Permissions, changes) if err != nil { return fmt.Errorf("Generating Folder Permission Changes: %w", err) }