File tree 3 files changed +7
-12
lines changed
3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { ApiOAuth2 } from '@nestjs/swagger';
3
3
import * as config from 'config' ;
4
4
import { RolesGuard } from '../../../common/authorization/roles-guard.service' ;
5
5
import { UserRoles } from '../../../common/authorization/roles.decorator' ;
6
- import { AUTH_ROLE } from '../../../common/authorization/roles' ;
6
+ import { ANY_ROLE_BUT_COMMISSIONER , AUTH_ROLE } from '../../../common/authorization/roles' ;
7
7
import { TagCategoryDto } from './tag-category.dto' ;
8
8
import { TagCategoryService } from './tag-category.service' ;
9
9
@@ -14,7 +14,7 @@ export class TagCategoryController {
14
14
constructor ( private service : TagCategoryService ) { }
15
15
16
16
@Get ( '' )
17
- @UserRoles ( AUTH_ROLE . ADMIN )
17
+ @UserRoles ( ... ANY_ROLE_BUT_COMMISSIONER )
18
18
async fetch (
19
19
@Query ( 'pageIndex' ) pageIndex : number ,
20
20
@Query ( 'itemsPerPage' ) itemsPerPage : number ,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import * as config from 'config';
4
4
import { RolesGuard } from '../../common/authorization/roles-guard.service' ;
5
5
import { UserRoles } from '../../common/authorization/roles.decorator' ;
6
6
import { TagService } from './tag.service' ;
7
- import { AUTH_ROLE } from '../../common/authorization/roles' ;
7
+ import { ANY_ROLE_BUT_COMMISSIONER , AUTH_ROLE } from '../../common/authorization/roles' ;
8
8
import { TagDto } from './tag.dto' ;
9
9
10
10
@Controller ( 'tag' )
@@ -14,7 +14,7 @@ export class TagController {
14
14
constructor ( private service : TagService ) { }
15
15
16
16
@Get ( '' )
17
- @UserRoles ( AUTH_ROLE . ADMIN )
17
+ @UserRoles ( ... ANY_ROLE_BUT_COMMISSIONER )
18
18
async fetch (
19
19
@Query ( 'pageIndex' ) pageIndex : number ,
20
20
@Query ( 'itemsPerPage' ) itemsPerPage : number ,
Original file line number Diff line number Diff line change @@ -18,12 +18,7 @@ export const ROLES_ALLOWED_APPLICATIONS = [
18
18
] ;
19
19
20
20
export const ROLES_ALLOWED_BOARDS = ROLES_ALLOWED_APPLICATIONS ;
21
- export const ROLES_ALLOWED_ARCHIVE = [
22
- AUTH_ROLE . ADMIN ,
23
- AUTH_ROLE . APP_SPECIALIST ,
24
- ] ;
21
+ export const ROLES_ALLOWED_ARCHIVE = [ AUTH_ROLE . ADMIN , AUTH_ROLE . APP_SPECIALIST ] ;
25
22
export const ANY_AUTH_ROLE = Object . values ( AUTH_ROLE ) ;
26
- export const ROLES_ALLOWED_SEARCH = [
27
- ...ROLES_ALLOWED_APPLICATIONS ,
28
- AUTH_ROLE . COMMISSIONER ,
29
- ] ;
23
+ export const ROLES_ALLOWED_SEARCH = [ ...ROLES_ALLOWED_APPLICATIONS , AUTH_ROLE . COMMISSIONER ] ;
24
+ export const ANY_ROLE_BUT_COMMISSIONER = Object . values ( AUTH_ROLE ) . filter ( ( role ) => role !== AUTH_ROLE . COMMISSIONER ) ;
You can’t perform that action at this time.
0 commit comments