Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix open in app for lightweight accounts #3626

Merged
merged 3 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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