Manual:Privilégios de Utilizador

From mediawiki.org
This page is a translated version of the page Manual:User rights and the translation is 39% complete.
Outdated translations are marked like this.

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'' */;
In a default installation $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 privilégios 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;
The group name cannot contain spaces, so use '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: Project: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 veja abaixo.

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 Extensão:Renameuser 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 “Especial:Versão” 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 Ler páginas - quando definido para false, substituir as páginas específicas com $wgWhitelistRead
Aviso Aviso: Setting the user right "read" (allow viewing pages) to false will only protect wiki (article, talk, ...) pages, but uploaded files (images, files, docs... in the $wgUploadPath subdirectories) will always remain readable via direct access by default.
Use the information from Manual:Image authorization and img_auth.php pages when you have the need to restrict image views and file download access to only logged-in users.
*, user 1.5+
Edição
applychangetags Aplicar etiquetas juntamente com as alterações - requires the edit right user 1.25+
autocreateaccount Aceder ao sistema automaticamente com uma conta de usuario externa - uma versão mais limitada de criar conta 1.27+
createaccount Criar novas contas de utilizador - register / registration *, sysop 1.5+
createpage Criar páginas (que não sejam páginas de discussão) - requer o privilégio edit *, user 1.6+
createtalk Criar páginas de discussão - requer o privilégio edit *, user 1.6+
delete-redirect Eliminar redirecionamentos com uma única revisão (note that this is not needed if the group already has the delete right) 1.36+
edit Editar páginas *, user 1.5+
editsemiprotected Editar páginas protegidas com "Allow only autoconfirmed users" - sem proteção em cascata - requires the edit right autoconfirmed, bot, sysop 1.22+
editprotected Editar páginas protegidas com "Allow only administrators" - sem proteção em cascata - requires the edit right sysop 1.13+
minoredit Marcar edições como menores - requires the edit right user 1.6+
move Mover páginas - requer o privilégio edit user, sysop 1.5+
move-categorypages Mover categorias - requer o privilégio move user, sysop 1.25+
move-rootuserpages Mover páginas raiz de utilizadores - requer o privilégio move user, sysop 1.14+
move-subpages Mover páginas com as suas subpáginas - requer o privilégio move user, sysop 1.13+
movefile Mover ficheiros - requer o privilégio move e $wgAllowImageMoving para ser true user, sysop 1.14+
reupload Sobrescrever um ficheiro existente - requer o privilégio upload user, sysop 1.6+
reupload-own Sobrescrever um ficheiro existente carregado pelo mesmo utilizador - requires the upload right (note that this is not needed if the group already has the reupload right) 1.11+
reupload-shared Sobrescrever localmente ficheiros no repositório partilhado de imagens - (if one is set up) with local files (requer o privilégio upload) user, sysop 1.6+
sendemail Enviar correio eletrónico a outros utilizadores user 1.16+
upload Carregar ficheiros - requires the edit right and $wgEnableUploads to be true user, sysop 1.5+
upload_by_url Carregar um ficheiro de um endereço URL - requer o privilégio upload (Prior to 1.20 it was given to sysops) 1.8+
Gestão
bigdelete Eliminar páginas com histórico grande (como determinado por $wgDeleteRevisionsLimit ) - requires the delete right sysop 1.12+
block Bloquear ou desbloquear a capacidade de edição de outros utilizadores - Block options include preventing editing and registering new accounts, and autoblocking other users on the same IP address sysop 1.5+
blockemail Bloquear ou desbloquear a capacidade de um utilizador enviar correio eletrónico - allows preventing use of the Special:Emailuser interface when blocking - requires the block right sysop 1.11+
browsearchive Pesquisar páginas eliminadas - através de Especial:Recuperar - requires the deletedhistory right sysop 1.13+
changetags Adicionar ou remover etiquetas arbitrárias em revisões e entradas de registo individuais - currently unused by extensions user 1.25+
delete Eliminar páginas 1.5–1.11: allows 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 Ver entradas de histórico eliminadas, sem o texto associado sysop 1.6+
deletedtext Ver texto eliminado e mudanças entre revisões eliminadas sysop
deletelogentry Eliminar e restaurar entradas específicas de registos - allows deleting/undeleting information (action text, summary, user who made the action) of specific log entries - requires the deleterevision right suppress 1.20+
deleterevision Eliminar e restaurar edições específicas de páginas - 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 Editar o modelo de conteúdo de uma página - requires the edit right user 1.23.7+
editinterface Editar a interface de utilizador - contém mensagens da interface. For editing sitewide CSS/JSON/JS, there are now segregate rights, see below. - requires the edit right sysop, interface-admin 1.5+
editmyoptions Editar as suas próprias preferências * 1.22+
editmyprivateinfo Editar os seus dados privados (por exemplo, endereço de correio eletrónico, nome real) e pedir mensagens de correio para reinício da palavra-passe - also hides the "Change Password", but not other ways to change the password - requires the viewmyprivateinfo right * 1.22+
editmyusercss Editar os seus próprios ficheiros CSS de utilizador - 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) - requires the edit right user 1.22+
editmyuserjs Editar os seus próprios ficheiros JavaScript de utilizador - 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) - requires the edit right user 1.22+
editmyuserjsredirect Editar os seus próprios ficheiros JavaScript de utilizador que são redirecionamentos (note that this is not needed if the group already has the edituserjs right) - requires the edit right 1.34+
editmyuserjson Editar os ficheiros JSON do próprio utilizador (note that this is not needed if the group already has the edituserjson right) - requires the edit right user 1.31+
editmywatchlist Editar a sua lista de páginas vigiadas (note que algumas ações continuarão a adicionar páginas, mesmo sem ter este direito) - requires the viewmywatchlist right * 1.22+
editsitecss Editar CSS global do site - requires the editinterface right interface-admin 1.32+
editsitejs Editar JavaScript global do site - requires the editinterface right interface-admin 1.32+
editsitejson Editar JSON global do site - requires the editinterface right sysop, interface-admin 1.32+
editusercss Editar os ficheiros CSS de outros utilizadores - requires the edit right interface-admin 1.16+
edituserjs Editar os ficheiros JS de outros utilizadores - requires the edit right interface-admin 1.16+
edituserjson Editar os ficheiros JSON de outros utilizadores - requires the edit right sysop, interface-admin 1.31+
hideuser Bloquear ou desbloquear um nome de utilizador, escondendo-o ou deixando de escondê-lo do público - Only users with 1000 edits or less can be suppressed by default - requires the block right

Use $wgHideUserContribLimit to disable.

suppress 1.10+
markbotedits Marcar edições revertidas como edições de robô - consulte [[Manual:Rollback |Manual:Administradores#Reverter]] - requires the rollback right sysop 1.12+
mergehistory Fundir o histórico de edições de páginas - requires the edit right sysop 1.12+
pagelang Alterar a língua da página - $wgPageLanguageUseDB must be true 1.24+
patrol Marcar edições de outros utilizadores como patrulhadas - $wgUseRCPatrol must be true sysop 1.5+
patrolmarks Ver marcações de patrulhamento das mudanças recentes 1.16+
protect Mudar configurações de proteção e editar páginas protegidas em cascata - requires the edit right sysop 1.5+
rollback Reverter rapidamente as edições do último utilizador que editou uma página em particular - requires the edit right sysop 1.5+
suppressionlog Ver registos privados suppress 1.6+
suppressrevision Ver, ocultar e restaurar revisões de páginas específicas para qualquer utilizador - Prior to 1.13 this right was named hiderevision - requires the deleterevision right suppress 1.6+
unblockself Desbloquear-se a si próprio - Without it, an administrator that has the capability to block cannot unblock themselves if blocked by another administrator sysop 1.17+
undelete Restaurar uma página - requires the deletedhistory right sysop 1.12+
userrights Editar todos os privilégios de utilizador - 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 Editar privilégios de utilizadores noutras wikis - requires the userrights right 1.12+
viewmyprivateinfo Ver os seus próprios dados privados (ex.: endereço de correio eletrónico, nome real) * 1.22+
viewmywatchlist Ver a sua lista de páginas vigiadas * 1.22+
viewsuppressed Ver revisões ocultas para qualquer utilizador - 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 Ter edições automaticamente marcadas como patrulhadas - $wgUseRCPatrol deve ser true bot, sysop 1.9+
deletechangetags Eliminar etiquetas da base de dados - currently unused by extensions sysop 1.28+
import Importar páginas de outras wikis - “transwiki” - requires the edit right sysop 1.5+
importupload Importar páginas de um ficheiro xml - This right was called 'importraw' in and before version 1.5 - requires the edit right sysop 1.5+
managechangetags Criar e (des)ativar etiquetas - currently unused by extensions sysop 1.25+
siteadmin Bloquear e desbloquear a base de dados - which blocks all interactions with the web site except viewing. (not available by default) 1.5+
unwatchedpages Ver uma lista de páginas não vigiadas - lists pages that no user has watchlisted sysop 1.6+
Técnico
apihighlimits Usar limites superiores nas consultas (queries) via API bot, sysop 1.12+
autoconfirmed Não ser afetado pelos limites de frequência de edição baseados em endereços IP - used for the 'autoconfirmed' group, see the other table below for more information autoconfirmed, bot, sysop 1.6+
bot Ser tratado como um processo automatizado - can optionally be viewed bot 1.5+
ipblock-exempt Contornar bloqueios de IP, bloqueios automáticos e bloqueios de gamas de IP sysop 1.9+
nominornewtalk Não desencadear o aviso de mensagens novas ao fazer edições menores a páginas de discussão - requires the minoredit right bot 1.9+
noratelimit Não ser afetado pelos limites de frequência de edição - 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 Exportar páginas incluindo páginas hiperligadas até uma profundidade de 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.
?
purge Purgar a cache de uma página - Parâmetro de URL "&action=purge" user 1.10+
suppressredirect Não criar um redirecionamento do nome antigo quando uma página é movida - requires the move right bot, sysop 1.12+
writeapi Usar a API de escrita - requires the edit right *, user, bot 1.13+
Embora todas estes privilégios controlem coisas separadas, às vezes para executar determinadas ações, precisa de vários privilégios. Por exemplo, permitir que os utilizadores editem mas não leiam páginas que não fazem sentido, porque para poder editar uma página deve poder lê-la primeiro (supondo que não tenha páginas na lista branca). Permitir envios, mas não editar, não faz sentido, pois, para poder enviar uma imagem, deve criar implicitamente uma página de descrição da imagem, etc.

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+
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.

Direitos predefinidos

Os privilégios predefinidos estão definidos no ficheiro DefaultSettings.php .

  • The default values in the latest stable MediaWiki release, version 1.39, are available here:

https://phabricator.wikimedia.org/diffusion/MW/browse/REL1_39/includes/DefaultSettings.php

  • Additional rights: you should be able to list all the permissions available on your wiki by running User::getAllRights().

Adicionar novos direitos

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 ...".

Consulte também