-
Notifications
You must be signed in to change notification settings - Fork 293
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
Refactor capabilities as they apply to dashboard sharing settings #5229
Labels
P1
Medium priority
PHP
QA: Eng
Requires specialized QA by an engineer
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Comments
aaemnnosttv
added
P1
Medium priority
Type: Enhancement
Improvement of an existing feature
labels
May 18, 2022
18 tasks
IB ✔️ |
18 tasks
18 tasks
QA Update: ✅Verified:
Added |
QA: Eng ✅Tested with the QAB of #4481. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P1
Medium priority
PHP
QA: Eng
Requires specialized QA by an engineer
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Feature Description
In #4481, capability checks were added to restrict which parts of the module sharing settings can be modified. This logic, while largely correct should be moved out of the module sharing settings class itself and live either in the controller or somewhere in between. Secondarily, the capability checks should be extended such that only users who can
DELEGATE_MODULE_SHARING_MANAGEMENT
can modify themanagement
value for a module's sharing settings.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Module_Sharing_Settings
classPOST:sharing-settings
as the only place where these are managed from Site Kit.MANAGE_MODULE_SHARING_OPTIONS
for a module, no change should be made to that module'ssharedRoles
valueDELEGATE_MODULE_SHARING_MANAGEMENT
for a module, no change should be made to that module'smanagement
valueImplementation Brief
Collection_Key_Cap_Filter
utility class which is designed to filter a specific key of each item in a given collection based on a capabilityPOST:sharing-settings
REST route definition before merging with the current sharing settingssharedRoles
key, requiring theMANAGE_MODULE_SHARING_OPTIONS
capabilitymanagement
key, requiring theDELEGATE_MODULE_SHARING_MANAGEMENT
capabilitymerge
the filtered result with the current sharing settingsModule_Sharing_Settings::merge
to matchModule_Settings::merge
Test Coverage
Collection_Key_Cap_Filter
Module_Sharing_Settings::merge
should be moved to theREST_Dashboard_Sharing_ControllerTest
, but only where current coverage is lackingQA Brief
QA
core/modules/data/sharing-settings
with a API client or browser console with valid and invalid data and make sure AC is met.Changelog entry
DELEGATE_MODULE_SHARING_MANAGEMENT
permission can modify themanagement
value for a module's sharing settings.The text was updated successfully, but these errors were encountered: