Skip to content

Commit

Permalink
Merge branch 'main' into feat/forms-1331-event-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
usingtechnology committed Sep 5, 2024
2 parents fcc9885 + dbe9498 commit f172fe1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 10 deletions.
36 changes: 27 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
<!-- Provide a general summary of your changes in the Title above -->
<!--
The above Title for the Pull Request should use the format:
type: FORMS-ABCD your change description
For example:
feat: FORMS-1234 add Assigned To column to submission table
-->

# Description

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->
<!--
Describe your changes in detail.
- Why is this change required?
- What problem does it solve?
-->

## Types of changes
## Type of Change

<!-- Uncomment the main reason for the change (for example, all feat PRs should include docs and test, but only uncomment feat): -->
<!--
Uncomment the main reason for the change. For example: all "feat" PRs should
include documentation ("docs") and tests ("test"), but only uncomment "feat".
-->

<!-- feat (a new feature) -->
<!-- fix (a bug fix) -->
Expand All @@ -18,6 +29,7 @@
<!-- docs (change to documentation) -->
<!-- perf (change to improve performance) -->
<!-- refactor (change to improve code quality) -->
<!-- revert (reverts changes in a previous commit) -->
<!-- style (change to code style/formatting) -->
<!-- test (add missing tests or correct existing tests) -->

Expand All @@ -27,8 +39,10 @@ This is a breaking change because ...

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
<!--
Go over all the following points, and put an `x` in all the boxes that apply. If
you're unsure about any of these, don't hesitate to ask. We're here to help!
-->

- [ ] I have read the [CONTRIBUTING](/bcgov/common-hosted-form-service/blob/main/CONTRIBUTING.md) doc
- [ ] I have checked that unit tests pass locally with my changes
Expand All @@ -39,4 +53,8 @@ This is a breaking change because ...

## Further comments

<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->
<!--
If this is a relatively large or complex change, kick off the discussion by
explaining why you chose the solution you did and what alternatives you
considered, etc...
-->
34 changes: 34 additions & 0 deletions app/src/db/migrations/20240904140843_047-extend-submitter-role.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const uuid = require('uuid');

const { Permissions, Roles } = require('../../forms/common/constants');

const CREATED_BY = 'migration-047';
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function(knex) {
return Promise.resolve().then(() => {
const rolePermission = {
id: uuid.v4(),
createdBy: CREATED_BY,
role: Roles.FORM_SUBMITTER,
permission: Permissions.DOCUMENT_TEMPLATE_READ,
};
return knex('role_permission').insert(rolePermission);
});
};

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function(knex) {
return Promise.resolve().then(() =>
knex('role_permission')
.where({
createdBy: CREATED_BY,
})
.del()
);
};
2 changes: 1 addition & 1 deletion app/src/forms/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = Object.freeze({
FORM_API_UPDATE: 'form_api_update',
FORM_DELETE: 'form_delete',
FORM_READ: 'form_read',
FORM_SUBMITTER: ['form_read', 'submission_create'],
FORM_SUBMITTER: ['form_read', 'submission_create', 'document_template_read'],
FORM_UPDATE: 'form_update',
SUBMISSION_CREATE: 'submission_create',
SUBMISSION_DELETE: 'submission_delete',
Expand Down

0 comments on commit f172fe1

Please sign in to comment.