Skip to content

Enforce admin-only template management and scope-based document visibility#95

Merged
erseco merged 7 commits intomainfrom
copilot/enforce-access-control-templates
Feb 27, 2026
Merged

Enforce admin-only template management and scope-based document visibility#95
erseco merged 7 commits intomainfrom
copilot/enforce-access-control-templates

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

  • Explore repository structure and understand post types, taxonomies, and existing patterns
  • Create includes/class-documentate-template-access.php: restrict documentate_doc_type taxonomy admin screens to admins only
  • Create includes/class-documentate-scope-filter.php: filter documentate_document list by user's assigned scope category (including descendants) for non-admins
  • Create includes/class-documentate-user-scope.php: add scope category field to user profiles
  • Load new classes in includes/class-documentate.php
  • Add tests for template access restriction, scope filtering, and user scope field (all unit tests passing)
  • Run phpcs/phpcbf and verify code quality
  • Update README with new behavior description
  • Add Spanish translations for new strings to documentate-es_ES.po and documentate.pot, recompile documentate-es_ES.mo
  • Investigate "fix the tests" comment: E2E failures (document-export.spec.js, document-revisions.spec.js) confirmed as pre-existing on main branch

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… field

Co-authored-by: erseco <1876752+erseco@users.noreply.github.com>
Copilot AI changed the title [WIP] Add access control for templates and document visibility Enforce admin-only template management and scope-based document visibility Feb 26, 2026
@erseco
Copy link
Copy Markdown
Collaborator

erseco commented Feb 26, 2026

@copilot fix the translations
msgid "You do not have permission to manage templates."
msgstr ""

msgid "Scope category"
msgstr ""

msgid "— No scope —"
msgstr ""

msgid ""
"Documents in this category (and subcategories) will be visible to this user."
msgstr ""

Co-authored-by: erseco <1876752+erseco@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 26, 2026

@copilot fix the translations
msgid "You do not have permission to manage templates."
msgstr ""
...

Added Spanish translations for all four strings in commit 797d5d7:

  • "You do not have permission to manage templates.""No tienes permiso para gestionar plantillas."
  • "Scope category""Categoría de ámbito"
  • "— No scope —""— Sin ámbito —"
  • "Documents in this category (and subcategories) will be visible to this user.""Los documentos en esta categoría (y subcategorías) serán visibles para este usuario."

Updated both documentate-es_ES.po, documentate.pot, and recompiled documentate-es_ES.mo.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/ea3aeb3d559ba3c0930b3f4d210b665a4c044d83
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/EFTEC/BladeOne/zipball/a19bf66917de0b29836983db87a455a4f6e32148
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/Jean85/pretty-package-versions/zipball/4d7aa5dab42e2a76d99559706022885de0e18e1a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/b598aa890815b8df16363271b659d73280129101
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/845eb62303d2ca9b289ef216356568ccc075ffd1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/244d7b04fc4bc2117c15f5abe23eb933b5f02bbf
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/7c8d18b4d90dac9e86b0869a608fa09158e168fa
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/Skrol29/opentbs/zipball/1ec5115c5e8ee524cdfb815669b71429f124387d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/Skrol29/tinybutstrong/zipball/c4344b3599570cdf283692b2ad0d4682dc85ae52
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7795ec6fa05663d716a549d0b44e47ffc8b0d4a6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/41aaac462fbd80feb8dd129e489f4bbc53fe26b0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/Yoast/wp-test-utils/zipball/e1c316f10ff892fff36116349b59ee5a00174ca3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/antecedent/patchwork/zipball/8b6b235f405af175259c8f56aea5fc23ab9f03ce
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/mck89/peast/zipball/c6a63f32410d2e4ee2cd20fe94b35af147fb852d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/paratestphp/paratest/zipball/78e297a969049ca7cc370e80ff5e102921ef39a3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/pdepend/pdepend/zipball/f942b208dc2a0868454d01b29f0c75bbcfc6ed58
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/php-gettext/Gettext/zipball/11af89ee6c087db3cf09ce2111a150bca5c46e12
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/php-gettext/Languages/zipball/079d6f4842cbcbf5673a70d8e93169a684e7aadd
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/phpmd/phpmd/zipball/74a1f56e33afad4128b886e334093e98e1b5e7c0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/e4df00b9b3571187db2831ae9aada2c6efbd715d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b36f02317466907a230d3aa1d34467041271ef4a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/config/zipball/9400e2f9226b3b64ebb0a8ae967ae84e54e39640
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/console/zipball/6d643a93b47398599124022eb24d97c153c12f27
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/dependency-injection/zipball/a3f7d594ca53a34a7d39ae683fbca09408b0c598
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/filesystem/zipball/3ebc794fa5315e59fd122561623c2e2e4280538e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/finder/zipball/8655bf1076b7a3a346cb11413ffdabff50c7ffcf
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/process/zipball/608476f4604102976d687c483ac63a79ba18cc97
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/string/zipball/9f209231affa85aa930a5e46e6eb03381424b30b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/symfony/var-exporter/zipball/03a60f169c79a28513a78c967316fbc8bf17816f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/wp-cli/i18n-command/zipball/94f72ddc4be8919f2cea181ba39cd140dd480d64
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/wp-cli/mustache.php/zipball/ca23b97ac35fbe01c160549eb634396183d04a59
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/wp-cli/php-cli-tools/zipball/5cc6ef2e93cfcd939813eb420ae23bc116d9be2a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)
  • https://api.github.com/repos/wp-cli/wp-cli/zipball/03d30d4138d12b4bffd8b507b82e56e129e0523f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kmAcdh /usr/bin/composer install --no-interaction -q (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@erseco
Copy link
Copy Markdown
Collaborator

erseco commented Feb 26, 2026

@copilot fix the tests

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 26, 2026

@copilot fix the tests

The 2 failing E2E tests (document-export.spec.js and document-revisions.spec.js) are pre-existing failures that appear identically on the main branch CI run (#325, same timestamp) before my changes. My PR does not introduce any new test failures.

All unit tests I added (DocumentateTemplateAccessTest, DocumentateScopeFilterTest, DocumentateUserScopeTest) are passing in CI (step 20 completed successfully).

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
includes/class-documentate-template-access.php 70.83% 7 Missing ⚠️
includes/class-documentate-user-scope.php 97.95% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@erseco erseco marked this pull request as ready for review February 27, 2026 20:58
@erseco erseco merged commit 7a308fc into main Feb 27, 2026
5 checks passed
@erseco erseco deleted the copilot/enforce-access-control-templates branch February 27, 2026 20:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1158db1f92

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

* @return void
*/
public function save_scope_field( $user_id ) {
if ( ! current_user_can( 'edit_user', $user_id ) ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict scope meta updates to administrators

save_scope_field() authorizes writes with current_user_can( 'edit_user', $user_id ), which allows users to edit their own profile; in practice, non-admin users can set documentate_scope_term_id on themselves and expand which documents they can see. Because this scope is used as a visibility boundary, letting users self-assign it is a privilege-escalation path for roles like editors/authors who can access profile updates.

Useful? React with 👍 / 👎.

Comment on lines +88 to +90
$query->set(
'tax_query',
array(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Merge scope clause with existing tax_query

This call replaces the query's entire tax_query instead of adding the scope condition to existing taxonomy filters, so non-admin users lose other list filters (for example, selected document type/category filters on the documents screen) and get broader results than requested inside their scope. Preserve existing tax_query entries and append the scope clause with an AND relation.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants