Skip to content

Commit 8f68f05

Browse files
committed
fix(gateway): issue secureview token correctly
Signed-off-by: jkoberg <jkoberg@owncloud.com>
1 parent df0a61a commit 8f68f05

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bugfix: Fix view&download permission issue
2+
3+
When opening files with view&download permission (aka read), the appprovider would falsely issue a secureview token. This is fixed now.
4+
5+
https://github.com/cs3org/reva/pull/5055

internal/grpc/services/gateway/appprovider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func (s *svc) openLocalResources(ctx context.Context, ri *storageprovider.Resour
189189

190190
func buildOpenInAppRequest(ctx context.Context, ri *storageprovider.ResourceInfo, vm gateway.OpenInAppRequest_ViewMode, tokenmgr token.Manager, accessToken string, opaque *typespb.Opaque) (*providerpb.OpenInAppRequest, error) {
191191
// in case of a view only mode and a stat permission we need to create a view only token
192-
if vm == gateway.OpenInAppRequest_VIEW_MODE_VIEW_ONLY && ri.GetPermissionSet().GetStat() {
192+
if vm == gateway.OpenInAppRequest_VIEW_MODE_VIEW_ONLY && ri.GetPermissionSet().GetStat() && !ri.PermissionSet.GetInitiateFileDownload() {
193193
// Limit scope to the resource
194194
scope, err := scope.AddResourceInfoScope(ri, providerv1beta1.Role_ROLE_VIEWER, nil)
195195
if err != nil {

0 commit comments

Comments
 (0)