Download the PHP package mediawiki/smw-file-protect without Composer
On this page you can find all versions of the php package mediawiki/smw-file-protect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mediawiki/smw-file-protect
More information about mediawiki/smw-file-protect
Files in mediawiki/smw-file-protect
Package smw-file-protect
Short Description Protects files and namespaces in Semantic MediaWiki based on user rights and properties.
License GPL-2.0-or-later
Homepage https://github.com/ProteoWiki/SMWFileProtect
Informations about the package smw-file-protect
SMWFileProtect
Extension to protect access to files based on which pages they are embedded in and the SMW properties assigned to those pages.
Requires MediaWiki 1.43 or later, PHP 8.1 or later and Semantic MediaWiki. Version 0.4.0 and earlier do not protect anything on MediaWiki 1.40 or later.
Installation
Files must be served through img_auth.php, see
https://www.mediawiki.org/wiki/Manual:Image_authorization.
Note that img_auth.php only checks read permissions when anonymous users cannot read the
wiki ($wgGroupPermissions['*']['read'] = false). On a wiki that anonymous users can read, it
streams every file without asking any extension, so this extension only protects the File:
description pages. Since MediaWiki 1.43 that check is $publicWiki in
includes/filerepo/AuthenticatedFileEntryPoint.php.
How it works
A user can read a File: page, and download the file, unless a page that uses the file (via
imagelinks) denies them:
$SMWFileProtectReferNS: the page is in a namespace the user cannot read under Lockdown's$wgNamespacePermissionLockdown, resolved the same way Lockdown resolves it.$SMWFileProtectReferSMW: the page has values for one of$SMWFileProtectReferUsersand none of them is the user's page, or a value for one of$SMWFileProtectReferPropsthat is not true. Pages without these properties do not restrict anything.
Users in $SMWFileProtectRights can always read files.