手册:$wgGroupPermissions

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$wgGroupPermissions and the translation is 71% complete.

Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎magyar • ‎polski • ‎português do Brasil • ‎русский • ‎中文 • ‎日本語 • ‎한국어
用户访问: $wgGroupPermissions
使用这个来设置用户所在用户组的权限。
引进版本:1.5.0 (r9367)
移除版本:仍在使用
允许的值:(复杂的布尔值数组。)
默认值:参见下方。

详情

$wgGroupPermissions is a two-dimensional array indexed by user group and available permissions. 值可以被设定为TRUE来授予权限,设置为FLASE将不授予权限。

Those permissions, which are granted with $wgGroupPermissions are always cumulative. If a user is member of different groups, then the user will get a right if it is granted to at least one of these groups even if it is not granted to his other groups. In other words, If one of the user's groups has a right, then it is not possible to take the right away using $wgGroupPermissions. Instead use $wgRevokePermissions to revoke permissions.

例子

$wgGroupPermissions['user']['edit'] = true;

这将给所有已注册用户编辑页面的权利。

自定义用户组

你也可以定义你自己的用户组。 用户组的名称不能超过255个字符。 [1] 在DefaultSettings.php 或LocalSettings.php 中定义的组可以通过Special:Userrights界面分配给用户。

例子

# Start with assigning the default permissions from group "autoconfirmed"
$wgGroupPermissions['Trustworthy'] = $wgGroupPermissions['autoconfirmed'];
# Add the permissions from group "bot"
$wgGroupPermissions['Trustworthy'] = array_merge($wgGroupPermissions['Trustworthy'], $wgGroupPermissions['bot']);
# 变更了下面的权限:
$wgGroupPermissions['Trustworthy']['delete'] = true;
$wgGroupPermissions['Trustworthy']['protect'] = true;
$wgGroupPermissions['Trustworthy']['patrol'] = true;

这里创建了一个称为Trustworthy的用户组。

这个组的用户拥有与user用户组一样的权限。

然后,他们能够删除和保护页面、巡查编辑以及直接刷新缓存页面。

获取更多的内容,参见手册:用户权限

警告 警告: Functionality to make specific pages inaccessible has not been extensively tested for security. Use at your own risk!

默认值

默认值因版本而异。 You may find the one which apply to your mediawiki setup in DefaultSettings.php . 访问手册:用户权限 以了解更多信息

扩展的使用

一些扩展,例如RenameUser CheckUser ,添加了新的权限,也可以以相同的方式进行配置和分配。

参见

脚注

  1. 参阅在user_groups 表中ug_group 列的长度。