Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRPT-610 Add ENV BC Parks role #808

Merged
merged 2 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export class KeycloakService {
roles.includes(Constants.ApplicationRoles.ADMIN_WF) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_COS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_BCPARKS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ALC);

this.menus[recordTypes.ADMINISTRATIVE_SANCTION] =
Expand All @@ -190,6 +191,7 @@ export class KeycloakService {
roles.includes(Constants.ApplicationRoles.ADMIN_AGRI) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_COS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_BCPARKS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ALC);

this.menus[recordTypes.AGREEMENT] = inBaseAdminRole(roles);
Expand All @@ -209,6 +211,7 @@ export class KeycloakService {
roles.includes(Constants.ApplicationRoles.ADMIN_AGRI) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_COS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_BCPARKS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ALC);

this.menus[recordTypes.CORRESPONDENCE] = inBaseAdminRole(roles);
Expand All @@ -222,6 +225,7 @@ export class KeycloakService {
roles.includes(Constants.ApplicationRoles.ADMIN_AGRI) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_COS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_BCPARKS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ALC);

this.menus[recordTypes.MANAGEMENT_PLAN] = inBaseAdminRole(roles);
Expand All @@ -234,6 +238,7 @@ export class KeycloakService {
roles.includes(Constants.ApplicationRoles.ADMIN_AGRI) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_COS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_BCPARKS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ALC);

this.menus[recordTypes.PERMIT] = inBaseAdminRole(roles) || roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD);
Expand All @@ -245,6 +250,7 @@ export class KeycloakService {
roles.includes(Constants.ApplicationRoles.ADMIN_AGRI) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_COS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_BCPARKS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ALC);

this.menus[recordTypes.REPORT] = inBaseAdminRole(roles);
Expand All @@ -258,6 +264,7 @@ export class KeycloakService {
roles.includes(Constants.ApplicationRoles.ADMIN_AGRI) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_COS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_BCPARKS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ALC);

this.menus[recordTypes.WARNING] =
Expand All @@ -267,6 +274,7 @@ export class KeycloakService {
roles.includes(Constants.ApplicationRoles.ADMIN_AGRI) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_EPD) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_COS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ENV_BCPARKS) ||
roles.includes(Constants.ApplicationRoles.ADMIN_ALC);
}

Expand Down
19 changes: 19 additions & 0 deletions angular/projects/admin-nrpti/src/app/utils/constants/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class Constants {
ADMIN_AGRI: 'admin:agri',
ADMIN_ENV_EPD: 'admin:env-epd',
ADMIN_ENV_COS: 'admin:env-cos',
ADMIN_ENV_BCPARKS: 'admin:env-bcparks',
ADMIN_ALC: 'admin:alc'
};

Expand All @@ -22,6 +23,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
];

Expand Down Expand Up @@ -71,6 +73,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
],
LNG: [
Expand All @@ -81,6 +84,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
]
},
Expand All @@ -92,6 +96,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
],
LNG: [
Expand All @@ -101,6 +106,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
]
},
Expand Down Expand Up @@ -132,6 +138,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
],
LNG: [
Expand All @@ -141,6 +148,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
]
},
Expand All @@ -160,6 +168,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
],
LNG: [
Expand All @@ -169,6 +178,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
]
},
Expand All @@ -185,6 +195,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
],
LNG: [
Expand All @@ -195,6 +206,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
]
},
Expand All @@ -210,6 +222,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
],
LNG: [
Expand All @@ -219,6 +232,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
]
},
Expand All @@ -238,6 +252,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
],
LNG: [
Expand All @@ -247,6 +262,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
]
},
Expand All @@ -258,6 +274,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
],
LNG: [
Expand All @@ -267,6 +284,7 @@ export class Constants {
Constants.ApplicationRoles.ADMIN_AGRI,
Constants.ApplicationRoles.ADMIN_ENV_EPD,
Constants.ApplicationRoles.ADMIN_ENV_COS,
Constants.ApplicationRoles.ADMIN_ENV_BCPARKS,
Constants.ApplicationRoles.ADMIN_ALC
]
}
Expand All @@ -281,6 +299,7 @@ export class Constants {
[Constants.ApplicationRoles.ADMIN_AGRI]: ['Ministry of Agriculture'],
[Constants.ApplicationRoles.ADMIN_ENV_EPD]: ['Environmental Protection Division'],
[Constants.ApplicationRoles.ADMIN_ENV_COS]: ['Conservation Officer Service (COS)'],
[Constants.ApplicationRoles.ADMIN_ENV_BCPARKS]: ['BC Parks'],
[Constants.ApplicationRoles.ADMIN_ALC]: ['Agriculture Land Commission']
};

Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/post/administrative-penalty.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ADDITIONAL_ROLES = [
utils.ApplicationRoles.ADMIN_AGRI,
utils.ApplicationRoles.ADMIN_ENV_EPD,
utils.ApplicationRoles.ADMIN_ENV_COS,
utils.ApplicationRoles.ADMIN_ENV_BCPARKS,
utils.ApplicationRoles.ADMIN_ALC
];
exports.ADDITIONAL_ROLES = ADDITIONAL_ROLES;
Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/post/administrative-sanction.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ADDITIONAL_ROLES = [
utils.ApplicationRoles.ADMIN_AGRI,
utils.ApplicationRoles.ADMIN_ENV_EPD,
utils.ApplicationRoles.ADMIN_ENV_COS,
utils.ApplicationRoles.ADMIN_ENV_BCPARKS,
utils.ApplicationRoles.ADMIN_ALC
];
exports.ADDITIONAL_ROLES = ADDITIONAL_ROLES;
Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/post/court-conviction.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ADDITIONAL_ROLES = [
utils.ApplicationRoles.ADMIN_AGRI,
utils.ApplicationRoles.ADMIN_ENV_EPD,
utils.ApplicationRoles.ADMIN_ENV_COS,
utils.ApplicationRoles.ADMIN_ENV_BCPARKS,
utils.ApplicationRoles.ADMIN_ALC
];
exports.ADDITIONAL_ROLES = ADDITIONAL_ROLES;
Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/post/inspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ADDITIONAL_ROLES = [
utils.ApplicationRoles.ADMIN_AGRI,
utils.ApplicationRoles.ADMIN_ENV_EPD,
utils.ApplicationRoles.ADMIN_ENV_COS,
utils.ApplicationRoles.ADMIN_ENV_BCPARKS,
utils.ApplicationRoles.ADMIN_ALC
];
exports.ADDITIONAL_ROLES = ADDITIONAL_ROLES;
Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/post/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ADDITIONAL_ROLES = [
utils.ApplicationRoles.ADMIN_AGRI,
utils.ApplicationRoles.ADMIN_ENV_EPD,
utils.ApplicationRoles.ADMIN_ENV_COS,
utils.ApplicationRoles.ADMIN_ENV_BCPARKS,
utils.ApplicationRoles.ADMIN_ALC
];
exports.ADDITIONAL_ROLES = ADDITIONAL_ROLES;
Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/post/restorative-justice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ADDITIONAL_ROLES = [
utils.ApplicationRoles.ADMIN_AGRI,
utils.ApplicationRoles.ADMIN_ENV_EPD,
utils.ApplicationRoles.ADMIN_ENV_COS,
utils.ApplicationRoles.ADMIN_ENV_BCPARKS,
utils.ApplicationRoles.ADMIN_ALC
];
exports.ADDITIONAL_ROLES = ADDITIONAL_ROLES;
Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/post/ticket.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ADDITIONAL_ROLES = [
utils.ApplicationRoles.ADMIN_AGRI,
utils.ApplicationRoles.ADMIN_ENV_EPD,
utils.ApplicationRoles.ADMIN_ENV_COS,
utils.ApplicationRoles.ADMIN_ENV_BCPARKS,
utils.ApplicationRoles.ADMIN_ALC
];
exports.ADDITIONAL_ROLES = ADDITIONAL_ROLES;
Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/post/warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ADDITIONAL_ROLES = [
utils.ApplicationRoles.ADMIN_AGRI,
utils.ApplicationRoles.ADMIN_ENV_EPD,
utils.ApplicationRoles.ADMIN_ENV_COS,
utils.ApplicationRoles.ADMIN_ENV_BCPARKS,
utils.ApplicationRoles.ADMIN_ALC
];
exports.ADDITIONAL_ROLES = ADDITIONAL_ROLES;
Expand Down
9 changes: 9 additions & 0 deletions api/src/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
parameters:
- in: query
name: _id
Expand Down Expand Up @@ -681,6 +682,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
parameters:
- name: recordId
in: path
Expand Down Expand Up @@ -741,6 +743,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
parameters:
- name: recordId
in: path
Expand Down Expand Up @@ -807,6 +810,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
parameters:
- name: recordId
in: path
Expand Down Expand Up @@ -861,6 +865,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
parameters:
- in: body
name: data
Expand Down Expand Up @@ -897,6 +902,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
parameters:
- in: body
name: data
Expand Down Expand Up @@ -964,6 +970,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
consumes:
- multipart/form-data
parameters:
Expand Down Expand Up @@ -1042,6 +1049,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
parameters:
- name: recordId
in: path
Expand Down Expand Up @@ -1101,6 +1109,7 @@ paths:
- admin:alc
- admin:flnr-nro
- admin:env-cos
- admin:env-bcparks
parameters:
- name: docId
in: path
Expand Down
4 changes: 3 additions & 1 deletion api/src/utils/constants/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const ApplicationRoles = {
ADMIN: 'sysadmin',
ADMIN_AGRI: 'admin:agri',
ADMIN_BCMI: 'admin:bcmi',
ADMIN_ENV_EPD: 'admin:env-epd',
ADMIN_ENV_EPD: 'admin:env-epd',
ADMIN_ENV_BCPARKS: 'admin:env-bcparks',
ADMIN_ENV_COS: 'admin:env-cos',
ADMIN_FLNRO: 'admin:flnro',
ADMIN_FLNR_NRO: 'admin:flnr-nro',
Expand All @@ -31,6 +32,7 @@ exports.ApplicationLimitedAdminRoles = [
ApplicationRoles.ADMIN_AGRI,
ApplicationRoles.ADMIN_ENV_EPD,
ApplicationRoles.ADMIN_ENV_COS,
ApplicationRoles.ADMIN_ENV_BCPARKS,
ApplicationRoles.ADMIN_ALC
];

Expand Down