Skip to content

Remove the obsolete RegulatoryInspector role#2962

Open
ramonski wants to merge 2 commits into
2.xfrom
2.x-remove-regulatoryinspector
Open

Remove the obsolete RegulatoryInspector role#2962
ramonski wants to merge 2 commits into
2.xfrom
2.x-remove-regulatoryinspector

Conversation

@ramonski

Copy link
Copy Markdown
Contributor

Description of the issue/feature this PR addresses

The RegulatoryInspector role and its RegulatoryInspectors group are no longer used by SENAITE. They remained wired into the rolemap, every workflow definition, the worksheet access logic and the test suite as dead weight. This PR removes them and adds an upgrade step that cleans existing installations.

Current behavior before PR

  • RegulatoryInspector is declared in rolemap.xml and granted View, Access contents information, List folder contents, View Labels, View Results and View Navigation, plus state permissions across 11 workflow definitions.
  • setuphandlers.py creates a RegulatoryInspectors group mapped to the role.
  • Worksheet access logic treats the role as privileged (Worksheet.checkUserAccess, is_privileged_user in the worksheet folder views).
  • The role never carries any access that another role does not already provide, and it is not assigned in any default setup.

Desired behavior after PR is merged

  • The role, the group, all rolemap grants and all workflow grants are removed.
  • Worksheet access logic no longer references the role; privileged worksheet access is Manager/LabManager as before (the role added nothing the other privileged roles did not already grant).
  • A GenericSetup upgrade step (2746 -> 2747) removes the role from portal_role_manager (which also clears any direct assignments), removes the RegulatoryInspectors group, and drops the role from the portal's known roles, so existing sites are cleaned on upgrade.
  • No state's effective access changes: no workflow permission-map was left with zero roles by the removal.

Tests

The affected doctests pass:

bin/test-senaite -s senaite.core -t Rolemap -t Permissions -t WorkflowAnalysisSubmit -t WorkflowAnalysisReject -t WorkflowAnalysisPublish -t WorkflowReferenceAnalysisBlankSubmit -t WorkflowReferenceAnalysisControlSubmit -t WorkflowDuplicateAnalysisSubmit

Ran 8 tests with 0 failures, 0 errors and 0 skipped

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant