Manual:User rights/pt
Privilégios de Utilizador são permissões (tais como a capacidade de editar páginas ou bloquear utilizadores) que podem ser atribuídas a diferentes grupos de utilizadores. MediaWiki vem com uma definição predefinida de privilégios de utilizador e grupos de utilizadores, mas estes podem ser personalizadas. Esta página explica os privilégios e os grupos predefinidos e como os personalizar.
Para obter informação sobre como adicionar e remover os utilizadores da wiki individuais dos grupos, consulte Ajuda:Privilégios de Utilizador e de Grupos e Manual:Definir os grupos de utilizadores no MediaWiki .
Alterar privilégios de grupo
Uma instalação predefinida do MediaWiki atribui determinados privilégios aos grupos predefinidos (veja abaixo). Pode alterar os privilégios predefinidos editando a matriz $wgGroupPermissions em LocalSettings.php com a sintaxe.
$wgGroupPermissions['group']['right'] = true /* ou ''false'' */;
$wgGroupPermissions
will be set in includes/DefaultSettings.php
, but it is not present in LocalSettings.php
. You will then need to add it in that file.If a member has multiple groups, they get all the permissions from each of the groups they are in.
All users, including anonymous users, are in the '*'
group; all registered users are in the 'user'
group.
In addition to the default groups, you can arbitrarily create new groups using the same array.
Exemplos
This example will disable viewing of all pages not listed in $wgWhitelistRead , then re-enable for registered users only:
$wgGroupPermissions['*']['read'] = false;
# The following line is not actually necessary, since it's in the defaults. Setting '*' to false doesn't disable rights for groups that have the right separately set to true!
$wgGroupPermissions['user']['read'] = true;
This example will disable editing of all pages, then re-enable for users with confirmed email addresses only:
# Desativar para toda a gente.
$wgGroupPermissions['*']['edit'] = false;
# Disable for users, too: by default 'user' is allowed to edit, even if '*' is not.
$wgGroupPermissions['user']['edit'] = false;
# Make it so users with confirmed email addresses are in the group.
$wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED;
# Hide group from user list.
$wgImplicitGroups[] = 'emailconfirmed';
# Finally, set it to true for the desired group.
$wgGroupPermissions['emailconfirmed']['edit'] = true;
Criar um novo grupo e atribuir permissões ao mesmo
You can create new user groups by defining permissions for the according group name in $wgGroupPermissions[ 'group-name' ]
where group-name is the actual name of the group.
Additionally to assigning permissions, you should create these three wiki pages with fitting content:
- 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 Manual:$wgAddGroups and Manual:$wgRemoveGroups , you may need to customize those instead.
Exemplos
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 (conteúdo:
Membros do projeto
) - MediaWiki:Group-projectmember-member (conteúdo:
Membros do projeto
) - MediaWiki:Grouppage-projectmember (conteúdo:
Projeto:Membros do Projeto
)
This will ensure that the group will be referred to as "Project members" throughout the interface, and 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 (conteúdo:
Escritores
) - MediaWiki:Group-writer-member (conteúdo:
Escritor
) - MediaWiki:Grouppage-writer (conteúdo:
Projeto:Escrever
)
Remover grupos predefinidos
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>' ]. Para detalhes, consulte em baixo.
Exemplo
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.
This code should be placed after any require_once
lines that add extensions, such as Extension:AntiSpoof containing code that gives bureaucrats group permissions by default.
unset( $wgGroupPermissions['bureaucrat'] );
unset( $wgRevokePermissions['bureaucrat'] );
unset( $wgAddGroups['bureaucrat'] );
unset( $wgRemoveGroups['bureaucrat'] );
unset( $wgGroupsAddToSelf['bureaucrat'] );
unset( $wgGroupsRemoveFromSelf['bureaucrat'] );
In some extensions (Flow, Semantic MediaWiki, etc.), rights are added during extension registration or in a registration function. In this case, it could be necessary to use a registration function in LocalSettings.php to remove some predefined user groups:
$wgExtensionFunctions[] = function() use ( &$wgGroupPermissions ) {
unset( $wgGroupPermissions['oversight'] );
unset( $wgGroupPermissions['flow-bot'] );
};
Nota no grupo chamado de "utilizador"
With the above mechanism, you can remove the groups sysop, bureaucrat and bot, 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 logged-in user automatically is a member of that group.
This is hardcoded in MediaWiki and currently cannot be changed easily.
Lista de privilégios
Os seguintes privilégios de utilizador estão disponíveis na versão mais recente do MediaWiki. Se estiver a utilizar uma versão mais antiga, consulte Special:Version na sua wiki e veja se a sua versão faz parte da coluna “Versões”.
Privilégio | Descrição | Grupos de utilizadores que têm este privilégio por predefinição | Versões |
---|---|---|---|
Leitura | |||
read | Read pages - quando definido para false, substituir as páginas específicas com $wgWhitelistRead
|
*, user | 1.5+ |
Edição | |||
applychangetags | Apply tags along with one's changes - requer o privilégio edit
|
user | 1.25+ |
autocreateaccount | Automatically log in with an external user account - uma versão mais limitada de "criar uma conta" | — | 1.27+ |
createaccount | Create new user accounts - register / registration | *, sysop | 1.5+ |
createpage | Create pages (which are not discussion pages) - requer o privilégio edit
|
*, user | 1.6+ |
createtalk | Create discussion pages - requer o privilégio edit
|
*, user | 1.6+ |
delete-redirect | Delete single revision redirects (note que isto não é necessário se o grupo já possuir o privilégio delete )
|
— | 1.36+ |
edit | Edit pages | *, user | 1.5+ |
editsemiprotected | Edit pages protected as "Allow only autoconfirmed users" - sem proteção em cascata - requires the edit right | autoconfirmed, bot, sysop | 1.22+ |
editprotected | Edit pages protected as "Allow only administrators" - sem proteção em cascata - requires the edit right | sysop | 1.13+ |
minoredit | Mark edits as minor - requer o privilégio edit
|
user | 1.6+ |
move | Move pages - requer o privilégio edit
|
user, sysop | 1.5+ |
move-categorypages | Move category pages - requer o privilégio move
|
user, sysop | 1.25+ |
move-rootuserpages | Move root user pages - requer o privilégio move
|
user, sysop | 1.14+ |
move-subpages | Move pages with their subpages - requer o privilégio move
|
user, sysop | 1.13+ |
movefile | Move files - requer o privilégio move e $wgAllowImageMoving para ser true
|
user, sysop | 1.14+ |
reupload | Overwrite existing files - requer o privilégio upload
|
user, sysop | 1.6+ |
reupload-own | Overwrite existing files uploaded by oneself - requires the upload right (note that this is not needed if the group already has the reupload right)
|
— | 1.11+ |
reupload-shared | Override files on the shared media repository locally - (if one is set up) with local files (requer o privilégio upload )
|
user, sysop | 1.6+ |
sendemail | Send email to other users | user | 1.16+ |
upload | Upload files - requires the edit right and $wgEnableUploads to be true
|
user, sysop | 1.5+ |
upload_by_url | Upload files from a URL - requer o privilégio upload (Prior to 1.20 it was given to sysops)
|
— | 1.8+ |
Gestão | |||
bigdelete | Delete pages with large histories (como determinado por $wgDeleteRevisionsLimit ) - requer o privilégio "delete" | sysop | 1.12+ |
block | Block other users from editing - Block options include preventing editing and registering new accounts, and autoblocking other users on the same IP address | sysop | 1.5+ |
blockemail | Block a user from sending email - allows preventing use of the Special:Emailuser interface when blocking - requires the block right | sysop | 1.11+ |
browsearchive | Search deleted pages - através de Special:Undelete - requer o privilégio "deletedhistory" | sysop | 1.13+ |
changetags | Add and remove arbitrary tags on individual revisions and log entries - atualmente não utilizado pelas extensões | user | 1.25+ |
delete | Delete pages 1.5–1.11: allows the deletion or undeletion of pages. 1.12+: allows the deletion of pages. Para restaurações, existe agora o privilégio 'undelete', consulte em baixo |
sysop | 1.5+ |
deletedhistory | View deleted history entries, without their associated text | sysop | 1.6+ |
deletedtext | View deleted text and changes between deleted revisions | sysop | |
deletelogentry | Delete and undelete specific log entries - allows deleting/undeleting information (action text, summary, user who made the action) of specific log entries - requires the deleterevision right | suppress | 1.20+ |
deleterevision | Delete and undelete specific revisions of pages - 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 the content model of a page - requer o privilégio "edit" | user | 1.23.7+ |
editinterface | Edit the user interface - contém mensagens da interface. For editing sitewide CSS/JSON/JS, there are now segregate rights, see below. - requer o privilégio "edit" | sysop, interface-admin | 1.5+ |
editmyoptions | Edit your own preferences | * | 1.22+ |
editmyprivateinfo | Edit your own private data (e.g. email address, real name) - also hides the "Change Password", but not other ways to change the password - requer o privilégio viewmyprivateinfo
|
* | 1.22+ |
editmyusercss | Edit your own user CSS files - 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) - requer o privilégio "edit" | user | 1.22+ |
editmyuserjs | Edit your own user JavaScript files - 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) - requer o privilégio "edit" | user | 1.22+ |
editmyuserjsredirect | Edit your own user JavaScript files that are redirects (note that this is not needed if the group already has the edituserjs right) - requer o privilégio "edit" | — | 1.34+ |
editmyuserjson | Edit your own user JSON files (note that this is not needed if the group already has the edituserjson right) - requer o privilégio "edit" | user | 1.31+ |
editmywatchlist | Edit your own watchlist (note that some actions will still add pages even without this right) - requer o privilégio "viewmywatchlist "
|
* | 1.22+ |
editsitecss | Edit sitewide CSS - requer o privilégio "editinterface" | interface-admin | 1.32+ |
editsitejs | Edit sitewide JavaScript - requer o privilégio "editinterface" | interface-admin | 1.32+ |
editsitejson | Edit sitewide JSON - requer o privilégio "editinterface" | sysop, interface-admin | 1.32+ |
editusercss | Edit other users' CSS files - requer o privilégio "edit" | interface-admin | 1.16+ |
edituserjs | Edit other users' JavaScript files - requer o privilégio "edit" | interface-admin | 1.16+ |
edituserjson | Edit other users' JSON files - requer o privilégio "edit" | sysop, interface-admin | 1.31+ |
hideuser | Block a username, hiding it from the public - Only users with 1000 edits or less can be suppressed by default - requer o privilégio "block"
Use |
suppress | 1.10+ |
markbotedits | Mark rolled-back edits as bot edits - consulte Manual:Rollback - requer o privilégio "rollback" | sysop | 1.12+ |
mergehistory | Merge the history of pages - requer o privilégio "edit" | sysop | 1.12+ |
pagelang | Change page language - $wgPageLanguageUseDB must be true | — | 1.24+ |
patrol | Mark others' edits as patrolled - $wgUseRCPatrol must be true | sysop | 1.5+ |
patrolmarks | View recent changes patrol marks | — | 1.16+ |
protect | Change protection settings and edit cascade-protected pages - requer o privilégio "edit" | sysop | 1.5+ |
rollback | Quickly rollback the edits of the last user who edited a particular page - requer o privilégio "edit" | sysop | 1.5+ |
suppressionlog | View private logs | suppress | 1.6+ |
suppressrevision | View, hide and unhide specific revisions of pages from any user - Prior to 1.13 this right was named hiderevision - requer o privilégio "deleterevision" | suppress | 1.6+ |
unblockself | Unblock oneself - Without it, an administrator that has the capability to block cannot unblock themselves if blocked by another administrator | sysop | 1.17+ |
undelete | Undelete a page - requer o privilégio "deletedhistory" | sysop | 1.12+ |
userrights | Edit all user rights - allows the assignment or removal of all(*) groups to any user. (*)With $wgAddGroups and $wgRemoveGroups you can set the possibility to add/remove certain groups instead of all |
bureaucrat | 1.5+ |
userrights-interwiki | Edit user rights of users on other wikis - requires the userrights right | — | 1.12+ |
viewmyprivateinfo | View your own private data (e.g. email address, real name) | * | 1.22+ |
viewmywatchlist | View your own watchlist | * | 1.22+ |
viewsuppressed | View revisions hidden from any user - 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+ |
Administração | |||
autopatrol | Have one's own edits automatically marked as patrolled - $wgUseRCPatrol deve ser true | bot, sysop | 1.9+ |
deletechangetags | Delete tags from the database - atualmente não utilizado pelas extensões | sysop | 1.28+ |
import | Import pages from other wikis - “transwiki” - requer o privilégio "edit" | sysop | 1.5+ |
importupload | Import pages from a file upload - This right was called 'importraw' in and before version 1.5 - requer o privilégio "edit" | sysop | 1.5+ |
managechangetags | Create and (de)activate tags - atualmente não utilizado pelas extensões | sysop | 1.25+ |
siteadmin | Lock and unlock the database - which blocks all interactions with the web site except viewing. (não disponível por predefinição) | — | 1.5+ |
unwatchedpages | View a list of unwatched pages - lista as páginas que nenhum utilizador foi colocado na lista de observação | sysop | 1.6+ |
Técnico | |||
apihighlimits | Use higher limits in API queries | bot, sysop | 1.12+ |
autoconfirmed | Not be affected by IP-based rate limits - 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 | Be treated as an automated process - can optionally be viewed | bot | 1.5+ |
ipblock-exempt | Bypass IP blocks, auto-blocks and range blocks | sysop | 1.9+ |
nominornewtalk | Not have minor edits to discussion pages trigger the new messages prompt - requer o privilégio "minoredit" | bot | 1.9+ |
noratelimit | Not be affected by rate limits - 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 | Export pages including linked pages up to a depth of 5 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. |
— | ? |
suppressredirect | Not create redirects from source pages when moving pages - requer o privilégio "move" | bot, sysop | 1.12+ |
writeapi | Use of the write API - requer o privilégio "edit" | *, user, bot | 1.13+ |
Lista de grupos
Os seguintes grupos estão disponíveis na versão mais recente do MediaWiki. Se estiver a utilizar uma versão antiga, então alguns destes grupos podem não estar implementados.
Grupo | Descrição | Direitos predefinidos | Versões |
---|---|---|---|
* | todos os utilizadores (incluindo os anónimos) | createaccount, createpage, createtalk, edit, editmyoptions, editmyprivateinfo, editmywatchlist, read, viewmyprivateinfo, viewmywatchlist, writeapi | 1.5+ |
temp | Temporary user accounts (T330816) | Similar to * group | 1.41+ |
user | contas registadas. | applychangetags, changetags, createpage, createtalk, edit, editcontentmodel, editmyusercss, editmyuserjs, editmyuserjson, minoredit, move, move-categorypages, move-rootuserpages, move-subpages, movefile, purge, read, reupload, reupload-shared, sendemail, upload, writeapi | |
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, writeapi | 1.5+ |
sysop | users who by default can delete and restore pages, block and unblock users, et cetera. | apihighlimits, autoconfirmed, autopatrol, bigdelete, block, blockemail, browsearchive, createaccount, 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/JS. | editinterface, editsitecss, editsitejs, editsitejson, editusercss, edituserjs, edituserjson | 1.32+ |
bureaucrat | users who by default can change other users' rights. | noratelimit, userrights | 1.5+ |
suppress | deletelogentry, deleterevision, hideuser, suppressionlog, suppressrevision, viewsuppressed |
From MW 1.12, you can create your own groups into which users are automatically promoted (as with autoconfirmed and emailconfirmed) using $wgAutopromote . You can even create any custom group by just assigning rights to them.
Privilégios predefinidos
Os privilégios predefinidos estão definidos no ficheiro MainConfigSchema.php .
- Valores predefinidos na versão HEAD: https://phabricator.wikimedia.org/diffusion/MW/browse/master/includes/MainConfigSchema.php
- The default values in the latest stable MediaWiki release, version 1.41, are available here:
https://phabricator.wikimedia.org/diffusion/MW/browse/REL1_41/includes/MainConfigSchema.php
- Additional rights: you should be able to list all the permissions available on your wiki by running
User::getAllRights()
.
Adicionar novos privilégios
Informação para codificadores como se segue.
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 , $coreRights
(example).
If you're doing so in an extension , you instead need to use $wgAvailableRights .
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 ...".
Ver também
- Special:ListGroupRights – interliga a esta página de ajuda e poderá conter privilégios ainda não documentados
- Ajuda:Privilégios de Utilizador e de Grupos – a página de ajuda que descreve em como utilizar a interface Special:Userrights (para burocratas)
- Manual:Definir os grupos de utilizadores no MediaWiki – informação sobre a gestão e atribuição de grupos de utilizadores.
- Manual:$wgNamespaceProtection
- Manual:$wgAutopromote
- Manual:$wgAddGroups , Manual:$wgRemoveGroups
- Manual:Preventing access – exemplos
- Manual:Establishing a hierarchy of bureaucrats
- Categoria: Extensões dos direitos do utilizador – Muitas extensões relacionadas com os privilégios de utilizador