Skip to content

UR-4413 Fix - Admins cannot access content restricted by membership rules#1285

Open
saurab018 wants to merge 1 commit into
developfrom
UR-4413-admins-cannot-access-content-restricted-by-membership-rules
Open

UR-4413 Fix - Admins cannot access content restricted by membership rules#1285
saurab018 wants to merge 1 commit into
developfrom
UR-4413-admins-cannot-access-content-restricted-by-membership-rules

Conversation

@saurab018
Copy link
Copy Markdown
Contributor

@saurab018 saurab018 commented May 22, 2026

All Submissions:

Changes proposed in this Pull Request:

https://themegrill.atlassian.net/browse/UR-4413

The urm_check_user_membership_has_access() function in modules/functions-ur-modules.php was missing the is_super_admin() early-return that the pro version already has. As a result, when content is restricted via a membership rule, administrators were evaluated against the membership subscription check and blocked if they had no active membership — even though admins should always bypass restrictions.

Fix: Added if ( is_super_admin() ) { return true; } at the top of urm_check_user_membership_has_access(), matching the pro version exactly.

How to test the changes in this Pull Request:

  1. Install User Registration & Membership. Set a page/post to be restricted to a specific membership plan (restrict → membership rule).
  2. Log in as an Administrator user who is not subscribed to that membership plan. Navigate to the restricted page — before this fix the admin would be blocked and see the restriction message.
  3. Verify that after this fix the admin can access the restricted content without subscribing to the membership plan.
  4. Optionally, connect the admin user to a User Registration & Membership form (as noted in the ticket), then repeat steps 2–3 to confirm the fix holds in that scenario.
  5. Confirm that a non-admin user who is not a member of the required plan is still blocked as expected.

Types of changes:

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (modification of the currently available functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully ran tests with your changes locally?
  • Have you updated the documentation accordingly?

Changelog entry

Fix - Admins blocked from accessing content restricted by membership rules due to missing super admin bypass in urm_check_user_membership_has_access.

@saurab018 saurab018 self-assigned this May 22, 2026
@saurab018 saurab018 force-pushed the UR-4413-admins-cannot-access-content-restricted-by-membership-rules branch from 71025ea to de1b4be Compare May 22, 2026 01:30
@saurab018 saurab018 force-pushed the UR-4413-admins-cannot-access-content-restricted-by-membership-rules branch from de1b4be to fb94036 Compare May 22, 2026 01:33
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.

1 participant