Open
Conversation
Introduce MixedVisibilityFilesPrefixRestrictions config that maps file
name prefixes to required user group(s). Files matching a prefix are
restricted to users in the specified group(s), enforced via the
getUserPermissionsErrorsExpensive hook.
Config example in LocalSettings.php:
$wgMixedVisibilityFilesPrefixRestrictions = [
'Confidential_' => 'sysop',
'Internal_' => ['sysop', 'bureaucrat'],
];
Co-authored-by: jeffw16 <11380894+jeffw16@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mywikis/MixedVisibilityFiles/sessions/ccc440fc-ea21-44b8-8881-495abcb9bcd6
Co-authored-by: jeffw16 <11380894+jeffw16@users.noreply.github.com> Agent-Logs-Url: https://github.com/mywikis/MixedVisibilityFiles/sessions/ccc440fc-ea21-44b8-8881-495abcb9bcd6
Copilot created this pull request from a session on behalf of
jeffw16
March 25, 2026 22:29
View session
jeffw16
requested changes
Mar 26, 2026
jeffw16
requested changes
Mar 26, 2026
extension.json
Outdated
Member
There was a problem hiding this comment.
Change 1.39.15 to the latest version of 1.39
Author
There was a problem hiding this comment.
Updated to 1.39.17 (the latest 1.39 release) in ebf8c18.
Agent-Logs-Url: https://github.com/mywikis/MixedVisibilityFiles/sessions/cf6dc173-df89-4e2d-982a-bf7cce0761ad Co-authored-by: jeffw16 <11380894+jeffw16@users.noreply.github.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
Implements the ability to restrict files beginning with a certain prefix to specific user groups, as configured in
LocalSettings.php.Changes
New configuration:
$wgMixedVisibilityFilesPrefixRestrictionsA map of file name prefixes to required user group(s). Files whose name starts with a configured prefix are restricted to users in the specified group(s).
Example (
LocalSettings.php):With this configuration:
File:Confidential_Report.pdf→ only accessible by users in thesysopgroupFile:Internal_Memo.pdf→ accessible by users in eithersysoporbureaucratgroupsFile:Photo.jpg→ existing behavior (anonymous blocked unless__MAKE_FILE_PUBLIC__, registered users allowed)Implementation details
extension.json: Addedconfigsection withMixedVisibilityFilesPrefixRestrictions(default: empty). InjectedUserGroupManagerandMainConfigservices into the visibility hook handler.src/VisibilityHooks.php: Updated to check file names against configured prefix restrictions before applying existing anonymous-user logic. For prefix-matched files, anonymous users are always denied and registered users must belong to at least one of the required groups (checked viaUserGroupManager::getUserEffectiveGroups).Behavior
Notes
Security Summary
No security vulnerabilities were discovered. CodeQL found no analyzable code changes.