release: v3.1.0 — add 'authenticated' sentinel + rename Everyone → Public - #22
Merged
Merged
Conversation
… (v3.1.0) Adds a second sentinel rule type so admins can require a login without picking specific roles or users, and renames the public option so it is unambiguous about anonymous access. - AccessControlManager: new TYPE_AUTHENTICATED constant; user_has_access() returns true iff $user_id > 0 for this key, fires wpb_access_control_denied on the deny path. - RuleQuery: set_rule() / normalize_input() handle 'authenticated' as a sentinel row alongside 'everyone'. - RulesController: ac_key description mentions the new key. - React dropdown: "Everyone (no restriction)" → "Public (no login required)"; new "Any logged-in user" option added. - CHANGELOG + README: document the new sentinel, updated dropdown table, and access hierarchy. - Built assets rebuilt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AccessControlManager::TYPE_AUTHENTICATED('authenticated') sentinel — allows any logged-in user without a role/capability check.Everyone (no restriction)→Public (no login required)for clarity, and adds a new Any logged-in user option below it.'everyone'behavior and stored rows are unchanged; new key is additive.Changes
src/AccessControlManager.php— newTYPE_AUTHENTICATEDconstant;user_has_access()returns true iff\$user_id > 0for this key, fireswpb_access_control_deniedon the deny path.src/Database/Rule/RuleQuery.php—set_rule()/normalize_input()handle'authenticated'as a sentinel row alongside'everyone'.src/RestApi/RulesController.php— updatedac_keydescription.js/components/ProviderDropdown.js— renamed label + new option; bundle rebuilt.CHANGELOG.md— 3.1.0 entry.README.md— updated dropdown table, access hierarchy, DB storage convention.Test plan
access_control_key='everyone'continue to allow anonymous.access_control_key='authenticated'allow logged-in, deny logged-out.🤖 Generated with Claude Code