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

pkp/pkp-lib#5504 Control access to settings by user group #4431

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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 @@ -19,6 +19,7 @@
use APP\core\Application;
use PKP\controllers\grid\plugins\PluginGridHandler;
use PKP\controllers\grid\plugins\PluginGridRow;
use PKP\security\authorization\CanAccessSettingsPolicy;
use PKP\security\authorization\ContextAccessPolicy;
use PKP\security\authorization\PluginAccessPolicy;
use PKP\security\Role;
Expand Down Expand Up @@ -101,6 +102,7 @@ public function authorize($request, &$args, $roleAssignments)
} else {
$this->addPolicy(new ContextAccessPolicy($request, $roleAssignments));
}
$this->addPolicy(new CanAccessSettingsPolicy());
return parent::authorize($request, $args, $roleAssignments);
}
}
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
<migration class="APP\migration\upgrade\v3_5_0\I9475_RecoverLayoutFiles"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9462_UserUserGroupsStartEndDate"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9552_UserGroupsMasthead"/>
<migration class="PKP\migration\upgrade\v3_5_0\I5504_UserGroupsSettings"/>
<migration class="APP\migration\upgrade\v3_5_0\I9425_SeparateUIAndSubmissionLocales"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9709_UserUserGroupsMasthead"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9566_UserRememberToken"/>
Expand Down
16 changes: 9 additions & 7 deletions js/pkp.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/pkp
Submodule pkp updated 30 files
+2 −0 api/v1/contexts/PKPContextController.php
+3 −0 api/v1/emailTemplates/PKPEmailTemplateController.php
+7 −0 classes/file/PKPLibraryFileManager.php
+1 −0 classes/install/PKPInstall.php
+1 −0 classes/migration/install/RolesAndUserGroupsMigration.php
+47 −0 classes/migration/upgrade/v3_5_0/I5504_UserGroupsSettings.php
+42 −0 classes/security/authorization/CanAccessSettingsPolicy.php
+10 −42 classes/security/authorization/UserRolesRequiredPolicy.php
+43 −39 classes/template/PKPTemplateManager.php
+1 −1 classes/userGroup/DAO.php
+3 −1 classes/userGroup/Repository.php
+18 −2 classes/userGroup/UserGroup.php
+2 −0 controllers/grid/navigationMenus/NavigationMenuItemsGridHandler.php
+2 −1 controllers/grid/navigationMenus/NavigationMenusGridHandler.php
+2 −0 controllers/grid/plugins/PluginGalleryGridHandler.php
+2 −0 controllers/grid/settings/SetupGridHandler.php
+2 −0 controllers/grid/settings/category/CategoryCategoryGridHandler.php
+2 −0 controllers/grid/settings/languages/ManageLanguageGridHandler.php
+2 −0 controllers/grid/settings/languages/SubmissionLanguageGridHandler.php
+2 −0 controllers/grid/settings/reviewForms/ReviewFormElementsGridHandler.php
+2 −0 controllers/grid/settings/reviewForms/ReviewFormGridHandler.php
+2 −0 controllers/grid/settings/roles/UserGroupGridHandler.php
+25 −7 controllers/grid/settings/roles/form/UserGroupForm.php
+2 −0 controllers/grid/settings/user/UserGridHandler.php
+1 −0 dtd/userGroups.dtd
+71 −0 js/controllers/grid/settings/roles/form/UserGroupFormHandler.js
+3 −0 locale/en/manager.po
+6 −0 pages/management/ManagementHandler.php
+3 −0 schemas/userGroup.json
+3 −0 templates/controllers/grid/settings/roles/form/userGroupForm.tpl
6 changes: 3 additions & 3 deletions registry/userGroups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<groups>
<!-- Managerial Role -->
<group roleId="0x00000010" name="default.groups.name.manager" plural="default.groups.plural.manager" abbrev="default.groups.abbrev.manager" permitMetadataEdit="true" />
<group roleId="0x00000010" stages="1,3,4,5" name="default.groups.name.editor" plural="default.groups.plural.editor" abbrev="default.groups.abbrev.editor" permitMetadataEdit="true" masthead="true" />
<group roleId="0x00000010" stages="4,5" name="default.groups.name.productionEditor" plural="default.groups.plural.productionEditor" abbrev="default.groups.abbrev.productionEditor" permitMetadataEdit="true" />
<group roleId="0x00000010" name="default.groups.name.manager" plural="default.groups.plural.manager" abbrev="default.groups.abbrev.manager" permitMetadataEdit="true" permitSettings="true" />
<group roleId="0x00000010" stages="1,3,4,5" name="default.groups.name.editor" plural="default.groups.plural.editor" abbrev="default.groups.abbrev.editor" permitMetadataEdit="true" masthead="true" permitSettings="true" />
<group roleId="0x00000010" stages="4,5" name="default.groups.name.productionEditor" plural="default.groups.plural.productionEditor" abbrev="default.groups.abbrev.productionEditor" permitMetadataEdit="true" permitSettings="true" />

<!-- Section Editor Role -->
<group roleId="0x00000011" stages="1,3,4,5" name="default.groups.name.sectionEditor" plural="default.groups.plural.sectionEditor" abbrev="default.groups.abbrev.sectionEditor" permitMetadataEdit="true" masthead="true" />
Expand Down