Skip to content

Commit

Permalink
fix(storage): authorization checks not consistent with db permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanidis committed Nov 15, 2023
1 parent 87cc95c commit 2202583
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/storage/src/handlers/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class FileHandlers {
if (action === 'create' && request.queryParams.scope) {
const allowed = await this.grpcSdk.authorization?.can({
subject: `User:${request.context.user._id}`,
actions: [action],
actions: ['read'],
resource: request.params.scope,
});
if (!allowed || !allowed.allow) {
Expand Down Expand Up @@ -75,7 +75,7 @@ export class FileHandlers {
if (request.queryParams.scope) {
const allowed = await this.grpcSdk.authorization?.can({
subject: `User:${request.context.user._id}`,
actions: ['create'],
actions: ['read'],
resource: request.params.scope,
});
if (!allowed || !allowed.allow) {
Expand Down

0 comments on commit 2202583

Please sign in to comment.