Browse Source

feat: bring calendar view acl

pull/7611/head
Pranav C 10 months ago
parent
commit
5a8b5c0a75
  1. 9
      packages/nocodb/src/controllers/calendars.controller.ts
  2. 6
      packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts

9
packages/nocodb/src/controllers/calendars.controller.ts

@ -25,8 +25,7 @@ export class CalendarsController {
'/api/v1/db/meta/calendars/:calendarViewId', '/api/v1/db/meta/calendars/:calendarViewId',
'/api/v2/meta/calendars/:calendarViewId', '/api/v2/meta/calendars/:calendarViewId',
]) ])
// #TODO Enable ACL Later @Acl('calendarViewGet')
// @Acl('calendarViewGet')
async calendarViewGet(@Param('calendarViewId') calendarViewId: string) { async calendarViewGet(@Param('calendarViewId') calendarViewId: string) {
return await this.calendarsService.calendarViewGet({ return await this.calendarsService.calendarViewGet({
calendarViewId, calendarViewId,
@ -38,8 +37,7 @@ export class CalendarsController {
'/api/v2/meta/tables/:tableId/calendars', '/api/v2/meta/tables/:tableId/calendars',
]) ])
@HttpCode(200) @HttpCode(200)
// #TODO Enable ACL Later @Acl('calendarViewCreate')
// @Acl('calendarViewCreate')
async calendarViewCreate( async calendarViewCreate(
@Param('tableId') tableId: string, @Param('tableId') tableId: string,
@Body() body: ViewCreateReqType, @Body() body: ViewCreateReqType,
@ -57,8 +55,7 @@ export class CalendarsController {
'/api/v1/db/meta/calendars/:calendarViewId', '/api/v1/db/meta/calendars/:calendarViewId',
'/api/v2/meta/calendars/:calendarViewId', '/api/v2/meta/calendars/:calendarViewId',
]) ])
// #TODO Enable ACL Later @Acl('calendarViewUpdate')
// @Acl('calendarViewUpdate')
async calendarViewUpdate( async calendarViewUpdate(
@Param('calendarViewId') calendarViewId: string, @Param('calendarViewId') calendarViewId: string,
@Body() body, @Body() body,

6
packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts

@ -81,13 +81,15 @@ export class ExtractIdsMiddleware implements NestMiddleware, CanActivate {
params.formViewId || params.formViewId ||
params.gridViewId || params.gridViewId ||
params.kanbanViewId || params.kanbanViewId ||
params.galleryViewId params.galleryViewId ||
params.calendarViewId
) { ) {
const view = await View.get( const view = await View.get(
params.formViewId || params.formViewId ||
params.gridViewId || params.gridViewId ||
params.kanbanViewId || params.kanbanViewId ||
params.galleryViewId, params.galleryViewId ||
params.calendarViewId,
); );
req.ncBaseId = view?.base_id; req.ncBaseId = view?.base_id;
} else if (params.publicDataUuid) { } else if (params.publicDataUuid) {

Loading…
Cancel
Save