Skip to content

[1.x] fix(tags): exclude bypassTagCounts from DiscussionPolicy catch-all#4538

Merged
imorland merged 2 commits into1.xfrom
im/fix-bypass-tag-counts-restricted
Apr 9, 2026
Merged

[1.x] fix(tags): exclude bypassTagCounts from DiscussionPolicy catch-all#4538
imorland merged 2 commits into1.xfrom
im/fix-bypass-tag-counts-restricted

Conversation

@imorland
Copy link
Copy Markdown
Member

@imorland imorland commented Apr 9, 2026

Fixes #4537

The catch-all can() method in DiscussionPolicy intercepted every discussion ability and checked for a per-tag variant (e.g. tag6.discussion.bypassTagCounts) that never exists. This caused bypassTagCounts to always deny non-admin users when the discussion was in a restricted tag.

The fix returns early from the catch-all when $ability === 'bypassTagCounts', letting the normal global permission check handle it instead.

The catch-all `can()` method in DiscussionPolicy intercepted every
discussion ability, including the `bypassTagCounts` meta-permission,
and checked for a per-tag variant (e.g. `tag6.discussion.bypassTagCounts`)
that never exists. This caused the permission check to always deny
non-admin users, even when they had been explicitly granted
`bypassTagCounts`, whenever the discussion was in a restricted tag.

Fixes #4537
@imorland imorland requested a review from a team as a code owner April 9, 2026 22:07
@imorland imorland modified the milestone: 1.8.15 Apr 9, 2026
@imorland imorland changed the title fix(tags): exclude bypassTagCounts from DiscussionPolicy catch-all [1.x] fix(tags): exclude bypassTagCounts from DiscussionPolicy catch-all Apr 9, 2026
@imorland imorland merged commit 1c17dcc into 1.x Apr 9, 2026
409 checks passed
@imorland imorland deleted the im/fix-bypass-tag-counts-restricted branch April 9, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1.x] [2.x] bypassTagCounts permission denied for non-admin users on discussions with restricted tags

2 participants