Skip to content

Feat/allow all logged users - #231

Open
omaraelhawary wants to merge 6 commits into
developfrom
feat/allow-all-logged-users
Open

Feat/allow all logged users#231
omaraelhawary wants to merge 6 commits into
developfrom
feat/allow-all-logged-users

Conversation

@omaraelhawary

Copy link
Copy Markdown
Collaborator

Adds a new Content Permissions option that restricts post access to any logged-in user, without requiring specific roles. This fills the gap between “public” (no roles selected) and “role-restricted” (one or more roles selected).

Previously, site owners could only restrict content to selected roles or leave it open to everyone. There was no way to say “members only” in the general sense — logged in, but not necessarily assigned a particular role.

Expose read/write/delete helpers and include the flag in members_has_post_permissions() so posts restricted to any logged-in user are treated as permissioned content.
Handle the new permission mode alongside role-based checks, gate access behind the login check to avoid guest bypass, and skip parent inheritance when the flag is set.
…a box.

Provide a checkbox that disables role selection when enabled, persist the flag on save with mutual exclusivity against roles, and sync the UI state in edit-post.js.
Register the meta field for REST, keep role and flag meta in sync on partial updates, fix protected-meta auth for writes, and add the checkbox to the document panel.
…nt permissions panel to ensure proper re-application of default settings.
@omaraelhawary omaraelhawary self-assigned this Jun 15, 2026
@omaraelhawary

Copy link
Copy Markdown
Collaborator Author

Could you please review https://screenrec.com/share/TYvF7rBpdz ?

Comment thread inc/template.php Outdated
Comment thread inc/functions-content-permissions.php Outdated

@ThemeGravity ThemeGravity left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@omaraelhawary Code looks good. I left comments but they are just minor issues, nothing serious. Thanks.

…onal post_id parameter for improved flexibility. Simplify logic in members_can_user_view_post to streamline access checks for logged-in users, ensuring clarity and efficiency in permission handling.
@omaraelhawary

Copy link
Copy Markdown
Collaborator Author

@cartpauj Could you please review https://screenrec.com/share/TYvF7rBpdz ?

@omaraelhawary
omaraelhawary requested a review from cartpauj June 15, 2026 13:23
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.

Feature: Add "Allow all logged-in users" shortcut to Content Permissions metabox

3 participants