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-697: added name redaction on issuingAgency and made datepicker years scrollable #813

Merged
merged 4 commits into from
Mar 30, 2021

Conversation

MaxWardle
Copy link
Contributor

NRPT-697: this is a recreation of the last PR to cleanup the commits

To test switch your role to admin:nrced or admin:lng only and create a record with issued to type individual, age over 19 and publish to NRCED or LNG. Verify that the created records have public in the base read, but not in the issued to read.

for the following issuing agencies you should see public in the issuedTo read array if the other age requirements are met:

exports.AUTHORIZED_PUBLISH_AGENCIES = [ 'BC Parks', 'Climate Action Secretariat', 'Conservation Officer Service (COS)', 'EAO', 'Environmental Protection Division' ];

Any edits should apply the correct roles to the issuedTo read array as well.

To test the migration, you can use:

db.nrpti.find({ issuingAgency: {$in: ["BC Oil and Gas Commission","Ministry of Energy, Mines and Low Carbon Innovation","Natural Resource Officers","Ministry of Forests, Lands, and Natural Resource Operations","Agricultural Land Commission","Ministry of Agriculture","BC Wildfire Service"]}, "issuedTo.type": "Individual","issuedTo.read": { $all: ["public"] }} ).pretty()

and then there should be none after you run the migration.

I also updated all of the datepickers to at least minDate vars. I checked with Kyle that dateIssued should not be able to be set in the future so added maxDate to those ones as well as the birthday datepickers.

Most of the datepickers are in admin nrpti, but there is one in public nrced

WIP: fixed publish name issue, now debuggging why the puts dont save other info

NRPT-697: added name redaction on issuingAgency and made datepicker years scrollable
Copy link
Contributor

@BcGovNeal BcGovNeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works good overall! One issue I'm seeing is the roles that are connected to issuing agencies do not get added to the read and write arrays.

For example, create a BC Wildfire Service record as admin. It will correctly not have public in issuedTo read and write. However it's missing admin:wf in the read and write, so a Wildfire user wouldn't be able to see the issueTo as well.

api/src/utils/put-utils.js Outdated Show resolved Hide resolved
api/migrations/20210309170828-redactPublicNames.js Outdated Show resolved Hide resolved
Copy link
Contributor

@BcGovNeal BcGovNeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! As mentioned, the additional role logic will be handled in another ticket: https://bcmines.atlassian.net/browse/NRPT-669

@sonarcloud
Copy link

sonarcloud bot commented Mar 30, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@MaxWardle MaxWardle merged commit da8129b into bcgov:master Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants