Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Fix scopes for user, groups routes
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 15, 2020
1 parent 1804bf3 commit c3dcb4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/modules/groups/groups.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class GroupController {
}

@Get(':groupId')
@Scopes('group-{id}:read-info')
@Scopes('group-{groupId}:read-info')
async get(
@Param('groupId', ParseIntPipe) id: number,
): Promise<Expose<groups>> {
Expand All @@ -52,7 +52,7 @@ export class GroupController {

@Patch(':groupId')
@AuditLog('update-info')
@Scopes('group-{id}:write-info')
@Scopes('group-{groupId}:write-info')
async update(
@Body() data: UpdateGroupDto,
@Param('groupId', ParseIntPipe) id: number,
Expand All @@ -62,7 +62,7 @@ export class GroupController {

@Put(':groupId')
@AuditLog('update-info')
@Scopes('group-{id}:write-info')
@Scopes('group-{groupId}:write-info')
async replace(
@Body() data: ReplaceGroupDto,
@Param('groupId', ParseIntPipe) id: number,
Expand All @@ -72,7 +72,7 @@ export class GroupController {

@Delete(':groupId')
@AuditLog('delete')
@Scopes('group-{id}:delete')
@Scopes('group-{groupId}:delete')
async remove(
@Param('groupId', ParseIntPipe) id: number,
): Promise<Expose<groups>> {
Expand Down
10 changes: 5 additions & 5 deletions src/modules/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ export class UserController {
}

@Get(':userId')
@Scopes('user-{id}:read-info')
@Scopes('user-{userId}:read-info')
async get(@Param('userId', ParseIntPipe) id: number): Promise<Expose<users>> {
return this.usersService.getUser(Number(id));
}

@Patch(':userId')
@Scopes('user-{id}:write-info')
@Scopes('user-{userId}:write-info')
async update(
@Param('userId', ParseIntPipe) id: number,
@Body() data: UpdateUserDto,
Expand All @@ -52,15 +52,15 @@ export class UserController {
}

@Delete(':userId')
@Scopes('user-{id}:deactivate')
@Scopes('user-{userId}:deactivate')
async remove(
@Param('userId', ParseIntPipe) id: number,
): Promise<Expose<users>> {
return this.usersService.deactivateUser(Number(id));
}

@Post(':userId/merge-request')
@Scopes('user-{id}:merge')
@Scopes('user-{userId}:merge')
@RateLimit({
points: 10,
duration: 60,
Expand All @@ -74,7 +74,7 @@ export class UserController {
}

@Post('merge')
@Scopes('user-{id}:merge')
@Scopes('user-{userId}:merge')
@RateLimit({
points: 10,
duration: 60,
Expand Down

0 comments on commit c3dcb4a

Please sign in to comment.