mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 08:34:55 +00:00
Update role guards to differentiate between admin and super admin roles
This commit is contained in:
@ -16,7 +16,7 @@ import { ResponseMessage } from '../../../libs/common/src/response/response.deco
|
||||
import { UserLoginDto } from '../dtos/user-login.dto';
|
||||
import { ForgetPasswordDto, UserOtpDto, VerifyOtpDto } from '../dtos';
|
||||
import { RefreshTokenGuard } from '@app/common/guards/jwt-refresh.auth.guard';
|
||||
import { AdminRoleGuard } from 'src/guards/admin.role.guard';
|
||||
import { SuperAdminRoleGuard } from 'src/guards/super.admin.role.guard';
|
||||
|
||||
@Controller({
|
||||
version: '1',
|
||||
@ -52,7 +52,7 @@ export class UserAuthController {
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(AdminRoleGuard)
|
||||
@UseGuards(SuperAdminRoleGuard)
|
||||
@Delete('user/delete/:id')
|
||||
async userDelete(@Param('id') id: string) {
|
||||
await this.userAuthService.deleteUser(id);
|
||||
@ -98,7 +98,7 @@ export class UserAuthController {
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(AdminRoleGuard)
|
||||
@UseGuards(SuperAdminRoleGuard)
|
||||
@Get('user/list')
|
||||
async userList() {
|
||||
const userList = await this.userAuthService.userList();
|
||||
|
||||
Reference in New Issue
Block a user