mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 10:14:54 +00:00
Update role guards to differentiate between admin and super admin roles
This commit is contained in:
@ -11,7 +11,7 @@ import {
|
||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { RoleService } from '../services/role.service';
|
||||
import { UserRoleEditDto } from '../dtos';
|
||||
import { AdminRoleGuard } from 'src/guards/admin.role.guard';
|
||||
import { SuperAdminRoleGuard } from 'src/guards/super.admin.role.guard';
|
||||
|
||||
@ApiTags('Role Module')
|
||||
@Controller({
|
||||
@ -21,7 +21,7 @@ import { AdminRoleGuard } from 'src/guards/admin.role.guard';
|
||||
export class RoleController {
|
||||
constructor(private readonly roleService: RoleService) {}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(AdminRoleGuard)
|
||||
@UseGuards(SuperAdminRoleGuard)
|
||||
@Get('types')
|
||||
async fetchRoleTypes() {
|
||||
try {
|
||||
@ -36,7 +36,7 @@ export class RoleController {
|
||||
}
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(AdminRoleGuard)
|
||||
@UseGuards(SuperAdminRoleGuard)
|
||||
@Put('edit/user/:userUuid')
|
||||
async editUserRoleType(
|
||||
@Param('userUuid') userUuid: string,
|
||||
|
||||
Reference in New Issue
Block a user