From b976591161c9bb8263ff8495ba333aba2e3ab005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 14 Dec 2020 15:22:02 +0000 Subject: [PATCH] fake permissions for share recipients at the driver level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/storage/fs/owncloud/owncloud.go | 20 ++++++++++++++++++-- pkg/storage/utils/eosfs/eosfs.go | 20 ++++++++++++++++++-- pkg/storage/utils/localfs/localfs.go | 20 ++++++++++++++++++-- 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/pkg/storage/fs/owncloud/owncloud.go b/pkg/storage/fs/owncloud/owncloud.go index 1a08f1b3e0e..15f0aff408e 100644 --- a/pkg/storage/fs/owncloud/owncloud.go +++ b/pkg/storage/fs/owncloud/owncloud.go @@ -566,8 +566,24 @@ func (fs *ocfs) permissionSet(ctx context.Context, owner *userpb.UserId) *provid } // TODO fix permissions for share recipients by traversing reading acls up to the root? cache acls for the parent node and reuse it return &provider.ResourcePermissions{ - ListContainer: true, - CreateContainer: true, + AddGrant: true, + CreateContainer: true, + Delete: true, + GetPath: true, + GetQuota: true, + InitiateFileDownload: true, + InitiateFileUpload: true, + ListContainer: true, + ListFileVersions: true, + ListGrants: true, + ListRecycle: true, + Move: true, + PurgeRecycle: true, + RemoveGrant: true, + RestoreFileVersion: true, + RestoreRecycleItem: true, + Stat: true, + UpdateGrant: true, } } func (fs *ocfs) convertToResourceInfo(ctx context.Context, fi os.FileInfo, ip string, sp string, c redis.Conn, mdKeys []string) *provider.ResourceInfo { diff --git a/pkg/storage/utils/eosfs/eosfs.go b/pkg/storage/utils/eosfs/eosfs.go index 87f53a3022e..f83ea47b0ae 100644 --- a/pkg/storage/utils/eosfs/eosfs.go +++ b/pkg/storage/utils/eosfs/eosfs.go @@ -1348,8 +1348,24 @@ func (fs *eosfs) permissionSet(ctx context.Context, owner *userpb.UserId) *provi } // TODO fix permissions for share recipients by traversing reading acls up to the root? cache acls for the parent node and reuse it return &provider.ResourcePermissions{ - ListContainer: true, - CreateContainer: true, + AddGrant: true, + CreateContainer: true, + Delete: true, + GetPath: true, + GetQuota: true, + InitiateFileDownload: true, + InitiateFileUpload: true, + ListContainer: true, + ListFileVersions: true, + ListGrants: true, + ListRecycle: true, + Move: true, + PurgeRecycle: true, + RemoveGrant: true, + RestoreFileVersion: true, + RestoreRecycleItem: true, + Stat: true, + UpdateGrant: true, } } diff --git a/pkg/storage/utils/localfs/localfs.go b/pkg/storage/utils/localfs/localfs.go index f49016e71f7..ee7d5ffd4ef 100644 --- a/pkg/storage/utils/localfs/localfs.go +++ b/pkg/storage/utils/localfs/localfs.go @@ -290,8 +290,24 @@ func (fs *localfs) permissionSet(ctx context.Context, owner *userpb.UserId) *pro } // TODO fix permissions for share recipients by traversing reading acls up to the root? cache acls for the parent node and reuse it return &provider.ResourcePermissions{ - ListContainer: true, - CreateContainer: true, + AddGrant: true, + CreateContainer: true, + Delete: true, + GetPath: true, + GetQuota: true, + InitiateFileDownload: true, + InitiateFileUpload: true, + ListContainer: true, + ListFileVersions: true, + ListGrants: true, + ListRecycle: true, + Move: true, + PurgeRecycle: true, + RemoveGrant: true, + RestoreFileVersion: true, + RestoreRecycleItem: true, + Stat: true, + UpdateGrant: true, } }