راهنما:حقوق کاربر
سطوح دسترسی کاربری به معنای مجموعهای از دسترسی ها(مانند توانایی ویرایش صفحات یا مسدود کردن کاربران) است که میتوانند به گروههای مختلف کاربری اختصاص داده شوند. مدیاویکی به صورت پیشفرض مجموعهای از سطوح دسترسی کاربری و گروههای کاربری ارائه میدهد، اما این موارد قابل شخصیسازی هستند. این صفحه نحوه توضیح سطوح دسترسی و گروههای پیشفرض و همچنین نحوه شخصیسازی آنها را شرح میدهد.
برای اطلاعات درباره نحوه افزودن یا حذف کاربران فردی از گروهها در ویکی، به منابع Help:اختیارات و گروههای کاربری و Manual:Setting user groups in MediaWiki مراجعه کنید.
تغییر دسترسی گروه
در یک نصب پیشفرض مدیاویکی، برخی از دسترسیها به گروههای پیشفرض اختصاص داده میشوند (به مثالهای زیر مراجعه کنید).
میتوانید دسترسیهای پیشفرض را با ویرایش آرایه $wgGroupPermissions در LocalSettings.php و با استفاده از سینتکس مربوطه تغییر دهید.
$wgGroupPermissions['group']['right'] = true /* یا false */;
$wgGroupPermissions در includes/DefaultSettings.php تنظیم میشود، اما در LocalSettings.php وجود ندارد. سپس باید آن را در فایل مربوطه اضافه کنید.اگر یک کاربر در چندین گروه عضویت داشته باشد، تمام دسترسیهای مربوط به هر یک از گروههایی که در آن عضویت دارد، به او اختصاص داده میشود.
تمام کاربران، از جمله کاربران ناشناس، در گروه * قرار دارند؛ تمام کاربران ثبتنامشده در گروه user عضویت دارند.
علاوه بر گروههای پیشفرض، میتوانید با استفاده از همان آرایه، گروههای جدیدی را به صورت دلخواه ایجاد کنید.
نمونهها
در این نمونه، مشاهده تمامی صفحاتی که در $wgWhitelistRead فهرست نشدهاند غیرفعال خواهد شد و سپس دسترسی مجدداً فقط برای کاربران ثبتنامشده فعال میشود.
$wgGroupPermissions['*']['read'] = false;
# خط زیر در واقع ضروری نیست، زیرا در تنظیمات پیشفرض تعریف شده است. تنظیم مقدار '*' به «نادرست» دسترسی را برای گروههایی که دسترسی آنها به طور جداگانه روی «درست» تنظیم شده باشد، غیرفعال نمیکند!
$wgGroupPermissions['user']['read'] = true;
این نمونه قابلیت ویرایش تمامی صفحات را غیرفعال میکند و سپس دسترسی مجدد را تنها برای کاربران با ایمیلهای تأییدشده فعال میکند.
# این تنظیم مشاهده صفحات را برای همه کاربران غیرفعال میکند.
$wgGroupPermissions['*']['edit'] = false;
# همچنین دسترسی را برای کاربران غیرفعال کنید: بهصورت پیشفرض، گروه «کاربر» اجازه ویرایش دارد، حتی اگر مقدار '*' غیرفعال تنظیم شده باشد.
$wgGroupPermissions['user']['edit'] = false;
# تعیین کنید که تنها کاربران دارای ایمیل تأییدشده در گروه تعریف شده عضو شوند.
$wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED;
# گروه را از فهرست کاربران پنهان کنید.
$wgImplicitGroups[] = 'emailconfirmed';
# در نهایت، مقدار آن را برای گروه موردنظر به «درست» تنظیم کنید.
$wgGroupPermissions['emailconfirmed']['edit'] = true;
Creating a new group and assigning permissions to it
A custom group can be created by simply assigning rights to it via $wgGroupPermissions[ 'group-name' ] where group-name is the actual name of the group.
From MW 1.12, you can create your own groups into which users are automatically promoted (as with autoconfirmed) using $wgAutopromote.
In addition to assigning permissions, you should create these three wiki pages with suitable content (see also the examples below):
- MediaWiki:Group-<group-name> (content:
Name of the group) - MediaWiki:Group-<group-name>-member (content:
Name of a member of the group) - MediaWiki:Grouppage-<group-name> (content:
Name of the group page)
By default, bureaucrats can add users to, or remove them from, any group.
However, if you are using $wgAddGroups and $wgRemoveGroups, you may need to customize those instead.
نمونهها
This example will create an arbitrary projectmember group that can block users and delete pages, and whose edits are hidden by default in the recent changes log:
$wgGroupPermissions['projectmember']['bot'] = true;
$wgGroupPermissions['projectmember']['block'] = true;
$wgGroupPermissions['projectmember']['delete'] = true;
'random-group' or 'random_group' instead of 'random group'. Moreover it is recommended to only use lowercase letters to create a group.In this example, you would probably also want to create these pages:
- MediaWiki:Group-projectmember (content:
Project members) - MediaWiki:Group-projectmember-member (content:
Project member) - MediaWiki:Grouppage-projectmember (content:
Project:Project Members)
This will ensure that the group will be referred to as "Project members" throughout the interface, a member will be referred to as a "Project member", and overviews will link the group name to Project:Project members.
This example disables write access (page editing and creation) by default, creates a group named writer, and grants it write access.
Users can be manually added to this group via Special:UserRights:
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['user']['createpage'] = false;
$wgGroupPermissions['writer']['edit'] = true;
$wgGroupPermissions['writer']['createpage'] = true;
In this example, you would probably also want to create these pages:
- MediaWiki:Group-writer (content:
Writers) - MediaWiki:Group-writer-member (content:
Writer) - MediaWiki:Grouppage-writer (content:
Project:Write)
List of permissions
The following user rights are available in the latest version of MediaWiki. If you are using an older version, look at Special:Version on your wiki and see if your version is covered in the "Versions" column.
| حق | توضیحات | User groups that have this right by default | نسخهها |
|---|---|---|---|
| خواندن | |||
| read | خواندن صفحهها – when set to false, override for specific pages with $wgWhitelistRead
Setting the user right
'read' to false only restricts access to wiki pages (such as articles and talk pages). Uploaded files (including images, files, docs) under the $wgUploadPath subdirectories will always remain publicly accessible via direct URL access by default.To restrict access to uploaded files, refer to the instructions in Manual:Image authorization and img_auth.php. |
*, user | 1.5+ |
| ویرایش کردن | |||
| applychangetags | زدن برچسبها همراه با تغییرات شخصی – حق edit را نیاز دارد
|
user | 1.25+ |
| autocreateaccount | ورود خودکار با یک حساب کاربری خارجی - نسخه محدود تری از createaccount
|
— | 1.27+ |
| createaccount | ایجاد حسابهای کاربری تازه – register / registration | *, sysop | 1.5+ |
| createpage | ایجاد صفحهها (که صفحههای بحث نیستند) – حق edit را نیاز دارد
|
*, user | 1.6+ |
| createpreviouslyrenamedaccount | ایجاد حسابهای کاربری با نامهای کاربری پیشتر استفادهشده توسط حسابهای تغییرنامیافته – requires the createaccount right
|
sysop | 1.47+ |
| createtalk | ایجاد صفحههای بحث – حق edit را نیاز دارد
|
*, user | 1.6+ |
| createwithcontentmodel | ایجاد صفحهها با مدلهای محتوای غیرپیشفرض – requires the createpage right
|
user | 1.46+ |
| delete-redirect | حذف تغییرمسیرهای تکنسخهای (note that this is not needed if the group already has the delete right)
|
— | 1.36+ |
| edit | ویرایش صفحهها – حق read را نیاز دارد
|
*, user | 1.5+ |
| editsemiprotected | ویرایش صفحههای محافظتشده (semi protected) – without cascading protection – حق edit را نیاز دارد
|
autoconfirmed, bot, sysop | 1.22+ |
| editprotected | ویرایش صفحههای محافظتشده (fully protected) – without cascading protection – حق edit را نیاز دارد
|
sysop | 1.13+ |
| minoredit | علامت زدن ویرایشها به عنوان جزئی – حق edit را نیاز دارد
|
user | 1.6+ |
| move | انتقال صفحهها – حق edit را نیاز دارد
|
user, sysop | 1.5+ |
| move-categorypages | انتقال صفحهٔ رده – حق move را نیاز دارد
|
user, sysop | 1.25+ |
| move-rootuserpages | انتقال صفحههای کاربری سرشاخه – حق move را نیاز دارد
|
user, sysop | 1.14+ |
| move-subpages | انتقال صفحهها به همراه زیرصفحههایشان – حق move را نیاز دارد
|
user, sysop | 1.13+ |
| movefile | انتقال پروندهها – همچنین حق move را نیز نیاز دارد
|
user, sysop | 1.14+ |
| reupload | بارگذاری دوبارهٔ پروندهای که از قبل وجود دارد – حق upload را نیاز دارد
|
user, sysop | 1.6+ |
| reupload-own | رونویسی پروندههای موجود بارگذاریشده توسط خودش – requires the upload right (note that this is not needed if the group already has the reupload right)
|
— | 1.11+ |
| reupload-shared | باطلکردن محلی پروندههای مشترک – (if one is set up) with local files (حق upload را نیاز دارد)
|
user, sysop | 1.6+ |
| sendemail | ارسال ایمیل به کاربران دیگر | user | 1.16+ |
| upload | بارگذاری پرونده – requires the edit right and $wgEnableUploads to be true
|
user, sysop | 1.5+ |
| upload_by_url | بارگذاری پرونده از یک نشانی اینترنتی – حق upload را نیاز دارد (Prior to 1.20 it was given to sysops)
|
— | 1.8+ |
| مدیریت | |||
| autopatrol | Modifies certain actions performed by the permission holder, automatically marking them as "patrolled" – Depends on $wgUseRCPatrol، $wgUseNPPatrol، $wgUseFilePatrol
|
bot, sysop | 1.9+ |
| bigdelete | حذف صفحههای دارای تاریخچهٔ بزرگ (as determined by $wgDeleteRevisionsLimit) – requires the delete right
|
sysop | 1.12+ |
| block | بستن یا باز کردن دسترسی کاربران دیگر به ویرایش – Block options include preventing editing and registering new accounts, and autoblocking other users on the same IP address | sysop | 1.5+ |
| blockemail | بستن یا باز کردن دسترسی یک کاربر به ارسال کردن ایمیل – allows preventing use of the Special:Emailuser interface when blocking – حق block را نیاز دارد
|
sysop | 1.11+ |
| browsearchive | جستجوی صفحههای حذفشده – through Special:Undelete – حق deletedhistory را نیاز دارد
|
sysop | 1.13+ |
| changetags | افزودن یا حذفکردن برچسبهای دلخواه روی نسخهها و ورودیهای سیاههٔ فردی – currently unused by extensions | user | 1.25+ |
| delete | حذف صفحهها 1.5-1.11allows the deletion or undeletion of pages 1.12+allows the deletion of pages (for undeletions, there is now the undelete right, see below)
|
sysop | 1.5+ |
| deletedhistory | مشاهدهٔ موارد حذفشده از تاریخچه، بدون دیدن متن آنها | sysop | 1.6+ |
| deletedtext | مشاهدهٔ متن حذفشده و تغییرات بین نسخههای حذفشده – حق deletedhistory را نیاز دارد
|
sysop | 1.16+ |
| deletelogentry | حذف و احیای مدخلهای خاصی از سیاهه – allows deleting/undeleting information (action text, summary, user who made the action) of specific log entries – requires the deleterevision right
|
suppress | 1.20+ |
| deleterevision | حذف و احیای نسخههای خاصی از صفحه – allows deleting/undeleting information (revision text, edit summary, user who made the edit) of specific revisions (Split into deleterevision and deletelogentry in 1.20)
|
suppress | 1.6+ |
| editcontentmodel | ویرایش مدل محتوای یک صفحه – حق edit را نیاز دارد
|
user | 1.23.7+ |
| editinterface | ویرایش واسط کاربری – contains interface messages. For editing sitewide CSS/JSON/JS, there are now segregate rights, see below. – حق edit را نیاز دارد
|
sysop, interface-admin | 1.5+ |
| editmyoptions | ویرایش ترجیحات خود | * | 1.22+ |
| editmyprivateinfo | ویرایش دادههای خصوصی خود (مانند آدرس ایمیل و نام واقعی) و درخواست ایمیل بازنشانی گذرواژه – همچنین "تغییر رمز عبور" را پنهان می کند، اما راه های دیگر برای تغییر رمز عبور نیست – حق viewmyprivateinfo را نیاز دارد
|
* | 1.22+ |
| editmyusercss | ویرایش پروندههای CSS کاربری خودتان – prior to 1.31 it was assigned to everyone (i.e. *) (note that this is not needed if the group already has the editusercss right) – حق edit را نیاز دارد
|
user | 1.22+ |
| editmyuserjs | ویرایش پروندههای JavaScript کاربری خودتان – prior to 1.31 it was assigned to everyone (i.e. *) (note that this is not needed if the group already has the edituserjs right) – حق edit را نیاز دارد
|
user | 1.22+ |
| editmyuserjsredirect | ویرایش فایلهای جاوااسکریپت حساب کاربری خودتان که تغییرمسیر هستند (note that this is not needed if the group already has the edituserjs right) – حق edit را نیاز دارد
|
— | 1.34+ |
| editmyuserjson | ویرایش پروندههای JSON کاربری خودتان (note that this is not needed if the group already has the edituserjson right) – حق edit را نیاز دارد
|
user | 1.31+ |
| editmywatchlist | فهرست پیگیریتان را ویرایش کنید. (توجه داشته باشید که برخی از اقدامات حتی بدون این دسترسی هم صفحات را به فهرست اضافه میکنند). – حق viewmywatchlist را نیاز دارد
|
user | 1.22+ |
| editsitecss | ویرایش گسترده CSS وبگاه – حق editinterface را نیاز دارد
|
interface-admin | 1.32+ |
| editsitejs | ویرایش گسترده JavaScript وبگاه – حق editinterface را نیاز دارد
|
interface-admin | 1.32+ |
| editsitejson | ویرایش گسترده JSON وبگاه – حق editinterface را نیاز دارد
|
sysop, interface-admin | 1.32+ |
| editusercss | ویرایش صفحههای CSS دیگر کاربرها – حق edit را نیاز دارد
|
interface-admin | 1.16+ |
| edituserjs | ویرایش صفحههای JS دیگر کاربرها – حق edit را نیاز دارد
|
interface-admin | 1.16+ |
| edituserjson | ویرایش پروندههای JSON دیگر کاربرها – حق edit را نیاز دارد
|
sysop, interface-admin | 1.31+ |
| hideuser | بستن یا باز کردن دسترسی یک کاربر و پنهان یا نمایان کردن آن از دید عموم – Only users with 1000 edits or less can be suppressed by default – حق block را نیاز دارد
Use |
suppress | 1.10+ |
| ignore-restricted-groups | گذر از شرایط ویرایش گروههای کاربری خاص دارای محدودیت – Only applies to groups the user would be otherwise able to change, based on userrights right and the contents of $wgAddGroups.
|
— | 1.46+ |
| markbotedits | علامت زدن ویرایشهای واگردانیشده به عنوان ویرایش ربات – Manual:Rollback را ببینید – حق rollback را نیاز دارد
|
sysop | 1.12+ |
| mergehistory | ادغام تاریخچهٔ صفحهها – حق edit را نیاز دارد
|
sysop | 1.12+ |
| pagelang | تغییر صفحهٔ زبان – $wgPageLanguageUseDB باید true باشد
|
— | 1.24+ |
| patrol | Mark certain actions as "patrolled" – depends on $wgUseRCPatrol، $wgUseNPPatrol، $wgUseFilePatrol
|
sysop | 1.5+ |
| patrolmarks | مشاهدهٔ برچسب گشت تغییرات اخیر (note that this is not needed if the group already has the patrol right)
|
— | 1.16+ |
| protect | تغییر تنظیمات محافظت صفحات و ویرایش صفحههای محافظتشده آبشاری – حق edit را نیاز دارد
|
sysop | 1.5+ |
| rollback | واگردانی سریع ویرایشهای آخرین کاربری که یک صفحه را ویرایش کرده است – حق edit را نیاز دارد
|
sysop | 1.5+ |
| suppressionlog | مشاهدهٔ سیاهههای خصوصی | suppress | 1.6+ |
| suppressrevision | مشاهده و احیای ویرایشهایی که از کاربران پنهان شدهاند – قبل از 1.13 این حق به hiderevision نامگذاری شده بود – حق deleterevision را نیاز دارد
|
suppress | 1.6+ |
| unblockself | بازکردن دسترسی خود – Without it, an administrator that has the capability to block cannot unblock themselves if blocked by another administrator | sysop | 1.17+ |
| undelete | احیای یک صفحه – حق deletedhistory را نیاز دارد
|
sysop | 1.12+ |
| userrights | ویرایش همهٔ اختیارات کاربری – allows the assignment or removal of all(*) groups to any user. (*)With |
bureaucrat | 1.5+ |
| userrights-interwiki | ویرایش اختیارات کاربری کاربران در ویکیهای دیگر – حق userrights را نیاز دارد
|
— | 1.12+ |
| viewmyprivateinfo | دادههای خصوصی خود را ببینید (مانند آدرس ایمیل و نام واقعی) | * | 1.22+ |
| viewmywatchlist | فهرست پیگیریتان را ببینید | user | 1.22+ |
| viewsuppressed | مشاهدهٔ نسخههای پنهانشده از دید هر کاربری – i.e. a more narrow alternative to suppressrevision (note that this is not needed if the group already has the suppressrevision right)
|
suppress | 1.24+ |
| مدیریت | |||
| deletechangetags | حذف برچسبها از پایگاه داده – currently unused by extensions | sysop | 1.28+ |
| import | درونریزی صفحهها از ویکیهای دیگر – "transwiki" – حق edit را نیاز دارد
|
sysop | 1.5+ |
| importupload | درونریزی صفحهها از یک بارگذاری پرونده – این حق در نسخه 1.5 و قبل از آن به عنوان importraw نامیده می شد – حق edit را نیاز دارد
|
sysop | 1.5+ |
| managechangetags | ایجاد و غیرفعال کردن برچسبها – در حال حاضر توسط تمدید ها استفاده نشده است | sysop | 1.25+ |
| renameuser | تغییر نام کاربران (قبلاً بخشی از تمدید تغییر نام کاربر بود) | bureaucrat | 1.40+ |
| siteadmin | قفلکردن و بازکردن پایگاههای داده – which blocks all interactions with the web site except viewing. (not available by default) | — | 1.5+ |
| unwatchedpages | مشاهدهٔ فهرست صفحههایی که پیگیری نمیشوند – lists pages that no user has watchlisted | sysop | 1.6+ |
| <span id="Technical">Technical | |||
| apihighlimits | استفادهٔ محدودههای بالاتر در پرسمانهای API | bot, sysop | 1.12+ |
| autoconfirmed | از محدودیتهای سرعت آیپی-محور تاثیر نمیگیرد – used for the autoconfirmed group; see the other table below for more information (note that this is not needed if the group already has the noratelimit right)
|
autoconfirmed, bot, sysop | 1.6+ |
| bot | بهعنوان یک فرایند خودکار در نظر گرفته شود – edits and logged actions are hidden from recent changes, can optionally be viewed | bot | 1.5+ |
| ipblock-exempt | تأثیر نپذیرفتن از قطع دسترسیهای آیپی، خودکار یا فاصلهای | sysop | 1.9+ |
| nominornewtalk | ویرایش جزئی صفحههای بحث به شکلی که باعث اعلان پیام تازه نشود – حق minoredit را نیاز دارد
|
bot | 1.9+ |
| noratelimit | تاثیر نپذیرفتن از محدودیت سرعت – not affected by rate limits (prior to the introduction of this right, the configuration variable $wgRateLimitsExcludedGroups was used for this purpose)
|
sysop, bureaucrat | 1.13+ |
| override-export-depth | برونبری صفحهها شامل صفحههای پیوند شده تا عمق ۵ With this right, you can define the depth of linked pages at Special:Export. Otherwise, the value of $wgExportMaxLinkDepth, which is 0 by default, will be used.
|
— | 1.15+ |
| suppressredirect | انتقال صفحه بدون ایجاد تغییرمسیر از نام قبلی – حق move را نیاز دارد
|
bot, sysop | 1.12+ |
Predefined groups
The following groups are available in the latest version of MediaWiki. If you are using an older version then some of these may not be implemented.
| گروه | توضیحات | حقوق پیش فرض | نسخهها |
|---|---|---|---|
| * | همه کاربران (از جمله ناشناس). | createaccount, createpage, createtalk, edit, editmyoptions, editmyprivateinfo, read, viewmyprivateinfo | 1.5+ |
| temp | حساب های موقت کاربر (T330816) | مشابه گروه *
|
1.41+ |
| user | کاربران عضو. Does not include temporary accounts. | applychangetags, changetags, createpage, createtalk, createwithcontentmodel, edit, editcontentmodel, editmyusercss, editmyuserjs, editmyuserjson, editmywatchlist, minoredit, move, move-categorypages, move-rootuserpages, move-subpages, movefile, purge, read, reupload, reupload-shared, sendemail, upload, viewmywatchlist | 1.13+ |
| autoconfirmed | Registered accounts at least as old as $wgAutoConfirmAge and having at least as many edits as $wgAutoConfirmCount.
|
autoconfirmed, editsemiprotected | 1.6+ |
| bot | Accounts with the bot right (intended for automated scripts). | autoconfirmed, autopatrol, apihighlimits, bot, editsemiprotected, nominornewtalk, suppressredirect | 1.5+ |
| sysop | Users who by default can delete and restore pages, block and unblock users, etc. | apihighlimits, autoconfirmed, autopatrol, bigdelete, block, blockemail, browsearchive, createaccount, createpreviouslyrenamedaccount, delete, deletedhistory, deletedtext, editinterface, editprotected, editsemiprotected, editsitejson, edituserjson, import, importupload, ipblock-exempt, managechangetags, markbotedits, mergehistory, move, move-categorypages, move-rootuserpages, move-subpages, movefile, noratelimit, patrol, protect, reupload, reupload-shared, rollback, suppressredirect, unblockself, undelete, unwatchedpages, upload | 1.5+ |
| interface-admin | Users who can edit sitewide CSS and JavaScript. | editinterface, editsitecss, editsitejs, editsitejson, editusercss, edituserjs, edituserjson | 1.32+ |
| bureaucrat | Users who can change the rights of other users by default and therefore have full access of the entire wiki. | noratelimit, renameuser, userrights | 1.5+ |
| suppress | deletelogentry, deleterevision, hideuser, suppressionlog, suppressrevision, viewsuppressed | 1.13+ |
Removing predefined groups
MediaWiki out of the box comes with a number of predefined groups. Most of these groups can be removed by unsetting the according array keys, among them $wgGroupPermissions[ 'group-name' ]. برای جزئیات، زیر را ببینید.
نمونهها
This example will eliminate the bureaucrat group entirely.
It is necessary to ensure that all six of these variables are unset for any group that one wishes to remove from being listed at Special:ListGroupRights; however, merely unsetting $wgGroupPermissions will suffice to remove it from Special:UserRights.
unset( $wgGroupPermissions['bureaucrat'] );
unset( $wgRevokePermissions['bureaucrat'] );
unset( $wgAddGroups['bureaucrat'] );
unset( $wgRemoveGroups['bureaucrat'] );
unset( $wgGroupsAddToSelf['bureaucrat'] );
unset( $wgGroupsRemoveFromSelf['bureaucrat'] );
This code will not work if any extension that modifies the default rights for the bureaucrat group, such as Extension:AntiSpoof, is installed.
More broadly, to disable a user group created by an extension, the above code needs to run after all extensions have been registered.
This used to be possible by registering an extension function in LocalSettings.php:
$wgExtensionFunctions[] = function() use ( &$wgGroupPermissions ) {
unset( $wgGroupPermissions['oversight'] );
unset( $wgGroupPermissions['flow-bot'] );
};
However, this no longer works reliably due to T275334.
user
With the above mechanism, you can remove the groups sysop، bureaucrat، bot، interface-admin، suppress, which - if used - can be assigned through the usual user permission system.
However, it is currently impossible to remove the user group.
This group is not assigned through the usual permission system.
Instead, every registered user automatically is a member of that group.
حقوق پیش فرض
حقوق پیش فرض در MainConfigSchema.php تعریف شده است.
- ارزش های پیش فرض در نسخه آلفا فعلی (HEAD، نسخه 1.48)
- Default values in the latest stable version (branch REL1_46, version 1.46)
- Additional rights: you should be able to list all the permissions available on your wiki by running
PermissionManager::getAllRights().
افزودن حقوق جدید
Information for coders only follows.
If you're adding a new right in core, for instance to control a new special page, you are required to add it to the list of available rights in PermissionManager.php, CORE_RIGHTS (example).
If you're doing so in an extension, you instead need to use $wgAvailableRights, or preferably define the right in extensions.json.
You probably also want to assign it to some user group by editing $wgGroupPermissions described above.
If you want this right to be accessible to external applications by OAuth or by bot passwords, then you will need to add it to a grant by editing $wgGrantPermissions.
// create projectmember-powers right
$wgAvailableRights[] = 'projectmember-powers';
// add projectmember-powers to the projectmember-group
$wgGroupPermissions['projectmember']['projectmember-powers'] = true;
// add projectmember-powers to the 'basic' grant so we can use our projectmember powers over an API request
$wgGrantPermissions['basic']['projectmember-powers'] = true;
You also need to add right-[name] and action-[name] interface messages to languages/i18n/en.json (with documentation in qqq.json).
The right-* messages can be seen on Special:ListGroupRights and the action-* messages are used in a sentence like "You do not have permission to ...".
جستارهای وابسته
- Special:ListGroupRights – Links to this help page and might contain not yet documented rights
- Help:اختیارات و گروههای کاربری – Help page describing use of the Special:Userrights interface (for bureaucrats)
- Manual:Setting user groups in MediaWiki – Information about managing and the assignment of user groups.
- Manual:$wgNamespaceProtection
- Manual:$wgAutopromote
- Manual:$wgAddGroups، Manual:$wgRemoveGroups
- Manual:Preventing access – نمونهها
- Manual:Establishing a hierarchy of bureaucrats
- Category:User rights extensions – بسیاری از افزونه های مربوط به حقوق کاربر