Skip to content

Clarify Unrestricted Preview Access setting description (#2133) - #3270

Open
faisalahammad wants to merge 1 commit into
gocodebox:devfrom
faisalahammad:fix/2133-unrestricted-preview-desc
Open

Clarify Unrestricted Preview Access setting description (#2133)#3270
faisalahammad wants to merge 1 commit into
gocodebox:devfrom
faisalahammad:fix/2133-unrestricted-preview-desc

Conversation

@faisalahammad

@faisalahammad faisalahammad commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates the description of the Unrestricted Preview Access setting to state that bypassing restrictions also requires the user to be able to edit the content. The current description promises a blanket bypass but never mentions the edit-capability check that llms_can_user_bypass_restrictions() has enforced since v5.9 (a deliberate security fix from #1974 / #1987 to stop instructors of one course bypassing restrictions on another). This is a documentation-only change. No logic, signature, or filter changed.

Fixes #2133

Changes

includes/admin/settings/class.llms.settings.general.php

Before:

'desc' => __( 'Users with the selected roles will bypass enrollment, drip, and prerequisite restrictions for courses and memberships.', 'lifterlms' ),

After:

'desc' => __( 'Users with the selected roles will bypass enrollment, drip, and prerequisite restrictions for courses and memberships. To bypass a restriction, the user must also be able to edit the content, for example by being assigned as an instructor of the course.', 'lifterlms' ),

Why: The setting id llms_grant_site_access feeds the allowlist, but the bypass only applies when the user also holds edit capability for the specific post. The description now matches the actual behavior, so admins are not surprised that an instructor assistant enrolled as a student in a course cannot bypass its drip locks.

Testing

Test 1: setting description renders correctly

  1. Go to WP Admin, then LifterLMS, then Settings, then General.
  2. Find the Unrestricted Preview Access row.
  3. Read the description.

Result: the description includes the second sentence noting the edit-capability requirement.

Test 2: role multi-select still saves

  1. On the same page, add or remove a role in the multi-select.
  2. Save.
  3. Reload the page.

Result: the selection persists and no PHP warnings show.

Screenshot

image

@faisalahammad
faisalahammad requested a review from brianhogg as a code owner July 24, 2026 04:00
@brianhogg brianhogg moved this to Awaiting Review in Development Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants