Skip to content

Commit

Permalink
Fix open in app for lightweight accounts (#3626)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 authored Feb 2, 2023
1 parent 40d38e4 commit 069fa0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog/unreleased/fix-lw-apps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix: Fix open in app for lightweight accounts

https://github.com/cs3org/reva/pull/3626
10 changes: 7 additions & 3 deletions internal/grpc/interceptors/auth/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ func expandAndVerifyScope(ctx context.Context, req interface{}, tokenScope map[s
return nil
}
}
log.Err(err).Msgf("error resolving reference %s under scope %+v", ref.String(), k)
if err != nil {
log.Err(err).Msgf("error resolving reference %s under scope %+v", ref.String(), k)
}
}
}

Expand Down Expand Up @@ -110,6 +112,8 @@ func checkLightweightScope(ctx context.Context, req interface{}, tokenScope map[
return true
case *provider.StatRequest:
return true
case *appregistry.GetAppProvidersRequest:
return true
case *provider.ListContainerRequest:
return hasPermissions(ctx, client, r.GetRef(), &provider.ResourcePermissions{
ListContainer: true,
Expand Down Expand Up @@ -142,11 +146,11 @@ func checkLightweightScope(ctx context.Context, req interface{}, tokenScope map[
return false
}
return hasPermissions(ctx, client, parent, &provider.ResourcePermissions{
InitiateFileDownload: true,
InitiateFileUpload: true,
})
case *provider.DeleteRequest:
return hasPermissions(ctx, client, r.GetRef(), &provider.ResourcePermissions{
InitiateFileDownload: true,
Delete: true,
})
case *provider.MoveRequest:
return hasPermissions(ctx, client, r.Source, &provider.ResourcePermissions{
Expand Down

0 comments on commit 069fa0f

Please sign in to comment.