Skip to content

fix(acl): Resource permission descriptions and class_map Resource Type UI - #17011

Open
Ibochkarev wants to merge 2 commits into
modxcms:3.xfrom
Ibochkarev:fix/issue-14479-resources-access-policy
Open

fix(acl): Resource permission descriptions and class_map Resource Type UI#17011
Ibochkarev wants to merge 2 commits into
modxcms:3.xfrom
Ibochkarev:fix/issue-14479-resources-access-policy

Conversation

@Ibochkarev

Copy link
Copy Markdown
Collaborator

What changed and why

Partial fix for #14479, following the 2026 re-check on the issue.

Most Resource keys already do what the processors and tree expect. Create / Update / Delete enforce type keys (new_weblink and friends) when you pick a derivative class_key. This PR covers the leftover UX and lexicon gaps.

  1. Resource Type without class_map — create/edit panel, create window, and quick create no longer mount modx-combo-class-derivatives. They keep a hidden class_key with the current value. That stops the access-denied popup from System/Derivatives/GetList. Processors still enforce new_* / edit_* on POST.
  2. English permission descriptionspublish_document is publish-only. delete_document is soft-delete (purge_deleted for permanent). edit_locked is Elements, not Resource session locks. steal_locks / object steal_lock both called out. Type keys note they sit on top of new_document. view_document vs Resource/Get / GetList clarified. class_map tied to the Resource Type combo.

Also removed a duplicate hidden class_key next to the combo in quick create.

How to test

class_map

  1. Policy without class_map: open Resource create/edit — no Resource Type combo, no Derivatives/GetList error, save keeps class_key.
  2. With class_map: combo loads as before.

Type keys (already in processors; smoke)

  1. Without new_weblink: create WebLink or change type to WebLink → denied.
  2. With new_weblink + new_document: same ops succeed.

Lexicon

  1. Clear lexicon cache, open Access Policy editor, check the updated English strings.

PHPUnit

php -l core/lexicon/en/permissions.inc.php
cd _build/test && ../../core/vendor/bin/phpunit --testsuite Controllers --filter ResourceAccessPolicyTest

8 tests, exit 0.

Related issue(s)/PR(s)

Refs #14479

Related: #14467 (trash / purge_deleted), #14434 (resource tree)

Compatibility notes

Manager UI + en lexicon only. Other locales keep old wording until Crowdin sync. No CHANGELOG entry.

Breaking change assessment

No public API changes. Without class_map, users no longer see Resource Type in those three forms. They still cannot load the type list via the processor. Creating/changing types still needs the matching new_* keys.

Test coverage

_build/test/Tests/Controllers/ResourceAccessPolicyTest.php — lexicon strings, class_map ternary in panel/window/tree, no duplicate quick-create class_key.

Contributors

@Ruslan-Aleev opened the issue. Scope from the 2026 re-check.

…s#14479)

Hide Resource Type combo without class_map (keep class_key as hidden).
Align en permission descriptions with soft-delete, publish-only,
edit_locked vs steal_locks, and view_document vs Get/GetList.
Collapse Resource Type field to a single conditional xtype, clarify
view_document vs Get/GetList policies, and note class_map is not a
create-type gate.
@Ibochkarev Ibochkarev added bug The issue in the code or project, which should be addressed. area-acl labels Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-acl bug The issue in the code or project, which should be addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant