Skip to content

Commit

Permalink
[SDPAP-8375]granted permissions to approvers to create and edit depar…
Browse files Browse the repository at this point in the history
…tment/sites (#453)

* granted permissions to approvers to create and edit department and sites only

* added behat tests

* added conditional

* fixed comment

* used array for permissions

* Update tide_core.install

* remove permission

* Fixed lint
  • Loading branch information
yeniatencio authored Feb 13, 2024
1 parent 4c292f1 commit e432bc5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/behat/features/access.feature
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ Feature: Access permissions
Given I am logged in as a user with the "Site Auditor" role
When I go to "/admin/reports/audit-trail"
Then I should get a 200 HTTP response

@api
Scenario: Approver role should not have access to redirects.
Given I am logged in as a user with the "approver" role
When I go to "admin/structure/taxonomy/add"
Then I should get a 404 HTTP response
15 changes: 15 additions & 0 deletions tide_core.install
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,18 @@ function tide_core_update_10003() {
$config->save();
}
}

/**
* Approver should not have access to administer taxonomy.
*/
function tide_core_update_10004() {
$role = 'approver';
$permissions = [
'administer taxonomy',
'edit terms in topic',
'delete terms in topic',
];
if ($role) {
user_role_revoke_permissions($role, $permissions);
}
}

0 comments on commit e432bc5

Please sign in to comment.