permissions
This commit is contained in:
@@ -16,6 +16,8 @@ import {
|
||||
import { RestId } from 'src/common/decorators';
|
||||
import { API_HEADER_SLUG } from 'src/common/constants';
|
||||
import { SuperAdminAuthGuard } from 'src/modules/auth/guards/superAdminAuth.guard';
|
||||
import { Permissions } from 'src/common/decorators/permissions.decorator';
|
||||
import { Permission } from 'src/common/enums/permission.enum';
|
||||
|
||||
@ApiTags('restaurants')
|
||||
@Controller()
|
||||
@@ -34,6 +36,7 @@ export class RestaurantsController {
|
||||
/** Admin Endpoints */
|
||||
@UseGuards(AdminAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Permissions(Permission.UPDATE_RESTAURANT)
|
||||
@Post('admin/restaurants')
|
||||
@ApiOperation({ summary: 'Create a new restaurant' })
|
||||
@ApiBody({ type: CreateRestaurantDto })
|
||||
@@ -44,7 +47,7 @@ export class RestaurantsController {
|
||||
|
||||
@UseGuards(AdminAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@ApiBearerAuth('admin/restaurants')
|
||||
@Permissions(Permission.UPDATE_RESTAURANT)
|
||||
@ApiOperation({ summary: 'Get restaurant by ID from request' })
|
||||
@Get('admin/restaurants/my-restaurant')
|
||||
async findOne(@RestId() restId: string) {
|
||||
@@ -53,6 +56,7 @@ export class RestaurantsController {
|
||||
|
||||
@UseGuards(AdminAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Permissions(Permission.UPDATE_RESTAURANT)
|
||||
@ApiOperation({ summary: 'Update a restaurant' })
|
||||
@ApiBody({ type: UpdateRestaurantDto })
|
||||
@Patch('admin/restaurants/my-restaurant')
|
||||
@@ -62,6 +66,7 @@ export class RestaurantsController {
|
||||
|
||||
@UseGuards(AdminAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Permissions(Permission.UPDATE_RESTAURANT)
|
||||
@ApiOperation({ summary: 'Delete a restaurant' })
|
||||
@Delete('admin/restaurants/:id')
|
||||
remove(@Param('id') id: string) {
|
||||
|
||||
Reference in New Issue
Block a user