第〇次调整
// 添加,定义新的保护等级 techedit
$wgRestrictionLevels[] = 'techedit';
// 添加,用于删除Widget、GlobalBlocking扩展预定义的widgeteditor、steward用户组
// This code should be placed after any require_once lines that add extensions.
$wgExtensionFunctions[] = function() use ( &$wgGroupPermissions ) {
unset( $wgGroupPermissions['widgeteditor'] );
unset( $wgGroupPermissions['steward'] );
};
// 新增以下内容
// checkuser
$wgGroupPermissions['checkuser']['globalblock'] = true;
$wgAddGroups['checkuser'] = [ 'ipblock-exempt' ];
$wgRemoveGroups['checkuser'] = [ 'ipblock-exempt' ];
// suppress
$wgGroupPermissions['suppress']['abusefilter-hide-log'] = true;
$wgGroupPermissions['suppress']['abusefilter-hidden-log'] = true;
// sysop
$wgGroupPermissions['sysop']['deleterevision'] = true;
$wgGroupPermissions['sysop']['deletebatch'] = true;
$wgGroupPermissions['sysop']['techedit'] = true;
$wgGroupsAddToSelf['sysop'] = array( 'interface-admin' );
$wgGroupsRemoveFromSelf['sysop'] = array( 'interface-admin' );
// patroller
$wgGroupPermissions['patroller']['suppressredirect'] = true;
$wgGroupPermissions['patroller']['reupload'] = true;
$wgGroupPermissions['patroller']['unwatchedpages'] = true;
// goodeditor
$wgGroupPermissions['goodeditor']['reupload-own'] = true;
// honoredmaintainer
$wgGroupPermissions['honoredmaintainer']['reupload-own'] = true;
// staff
$wgGroupPermissions['staff']['skipcaptcha'] = true;
$wgGroupPermissions['staff']['autopatrol'] = true;
$wgGroupPermissions['staff']['autoconfirmed'] = true;
$wgGroupPermissions['staff']['noratelimit'] = true;
$wgGroupPermissions['staff']['ipblock-exempt'] = true;
$wgGroupsAddToSelf['staff'] = array( 'interface-admin' , 'scripteditor' , 'sysop' );
$wgGroupsRemoveFromSelf['staff'] =array( 'interface-admin' , 'scripteditor' , 'sysop' );
// interface-admin, 升级MW至1.32+后为默认用户组,应移除该部分前4项
$wgGroupPermissions['interface-admin']['editusercss'] = true;
$wgGroupPermissions['interface-admin']['edituserjson'] = true;
$wgGroupPermissions['interface-admin']['edituserjs'] = true;
$wgGroupPermissions['interface-admin']['editinterface'] = true;
$wgGroupPermissions['interface-admin']['techedit'] = true;
// scripteditor
$wgGroupPermissions['scripteditor']['editwidgets'] = true;
$wgGroupPermissions['scripteditor']['techedit'] = true;
// techeditor
$wgGroupPermissions['techeditor']['techedit'] = true;
// abusefilter-maintainer
$wgGroupPermissions['abusefilter-maintainer']['abusefilter-modify'] = true;
$wgGroupPermissions['abusefilter-maintainer']['abusefilter-modify-restricted'] = true;
$wgGroupPermissions['abusefilter-maintainer']['abusefilter-revert'] = true;
$wgGroupPermissions['abusefilter-maintainer']['abusefilter-log-private'] = true;
// flood
$wgGroupPermissions['flood']['bot'] = true;
$wgGroupPermissions['flood']['noratelimit'] = true;
$wgGroupsRemoveFromSelf['flood'] = array( 'flood' );
// ipblock-exempt
$wgGroupPermissions['ipblock-exempt']['ipblock-exempt'] = true;
// 移除以下内容
// 恢复bot原有的权限
$wgGroupPermissions['bot']['suppressredirect'] = false;
// 删除删除执行员用户组
$wgGroupPermissions['删除执行员']['bigdelete'] = true;
$wgGroupPermissions['删除执行员']['undelete'] = true;
// 删除developer用户组
$wgGroupPermissions['developer']['upload'] = true;
$wgGroupPermissions['developer']['abusefilter-modify-restricted'] = true;
$wgGroupPermissions['developer']['abusefilter-modify'] = true;
$wgGroupPermissions['developer']['createtalk'] = true;
$wgGroupPermissions['developer']['createpage'] = true;
$wgGroupPermissions['developer']['editwidgets'] = true;
$wgGroupPermissions['developer']['abusefilter-revert'] = true;
$wgGroupPermissions['developer']['abusefilter-private'] = true;
$wgGroupPermissions['developer']['editinterface'] = true;
$wgGroupPermissions['developer']['edit'] = true;
// 修改以下内容
// 修改 $wgAddGroups['sysop']为
$wgAddGroups['sysop'] = [ 'patroller' , 'goodeditor' , 'techeditor' , 'flood' ];
// 修改 $wgRemoveGroups['sysop']为
$wgRemoveGroups['sysop'] = [ 'goodeditor' , 'techeditor' , 'flood' , 'honoredmaintainer' ];
第一次修订
// 添加
// sysop
$wgGroupPermissions['sysop']['abusefilter-log-private'] = true;
$wgTitleBlacklistLogHits = true;
$wgLogSpamBlacklistHits = true;
$wgGroupPermissions['user']['spamblacklistlog'] = false;
$wgGroupPermissions['sysop']['spamblacklistlog'] = true;
// checkuser
$wgGroupPermissions['checkuser']['abusefilter-private'] = true;
$wgGroupPermissions['checkuser']['abusefilter-private-log'] = true;
$wgAbuseFilterLogPrivateDetailsAccess = true;
$wgAbuseFilterPrivateDetailsForceReason = true;
$wgCheckUserForceSummary = true;
// patroller
$wgGroupPermissions['patroller']['apihighlimits'] = true;
// staff
$wgGroupPermissions['staff']['override-antispoof'] = true;
$wgGroupPermissions['staff']['tboverride'] = true;
$wgGroupPermissions['staff']['editprotected'] = true;
$wgGroupPermissions['staff']['patrolleredit'] = true;
$wgGroupPermissions['staff']['ajaxpoll-view-results-before-vote'] = true;
$wgGroupPermissions['staff']['reupload'] = true;
// goodeditor & honoredmaintainer
$wgGroupPermissions['goodeditor']['patrolmarks'] = true;
$wgGroupPermissions['honoredmaintainer']['patrolmarks'] = true;
// user & autoconfirmed
$wgGroupPermissions['user']['editcontentmodel'] = false;
$wgGroupPermissions['autoconfirmed']['editcontentmodel'] = true;
$wgGroupPermissions['user']['comment'] = false;
$wgGroupPermissions['autoconfirmed']['comment'] = true;
// 删除
$wgGroupPermissions['sysop']['abusefilter-private'] = true;
第二次修订
// 添加
// sysop
$wgGroupPermissions['sysop']['globalblock-exempt'] = true;
// staff
$wgGroupPermissions['staff']['globalblock-exempt'] = true;
$wgGroupPermissions['staff']['patrolmarks'] = true;
$wgGroupPermissions['staff']['suppressredirect'] = true;
$wgGroupPermissions['staff']['browsearchive'] = true;
$wgGroupPermissions['staff']['deletedhistory'] = true;
$wgGroupPermissions['staff']['deletedtext'] = true;
$wgGroupPermissions['staff']['viewsuppressed'] = true;
$wgGroupPermissions['staff']['suppressionlog'] = true;
// manually-confirmed
$wgGroupPermissions['manually-confirmed']['skipcaptcha'] = true;
$wgGroupPermissions['manually-confirmed']['autoconfirmed'] = true;
$wgGroupPermissions['manually-confirmed']['editsemiprotected'] = true;
// ipblock-exempt
$wgGroupPermissions['ipblock-exempt']['globalblock-exempt'] = true;
第三次修订
//允许sysop新增、移除manually-confirmed
$wgAddGroups['sysop'] 数组中添加 manually-confirmed
$wgRemoveGroups['sysop'] 数组中添加 manually-confirmed
//调整用户查核相关
$wgCUDMaxAge 值更改为 15552000 或更大 // https://www.mediawiki.org/wiki/Extension:CheckUser#Configuration
//STAFF新增权限
$wgGroupPermissions['staff']['upload_by_url'] = true;
$wgGroupPermissions['staff']['transcode-reset'] = true;
$wgGroupPermissions['staff']['move'] = true;
$wgGroupPermissions['staff']['move-categorypages'] = true;
$wgGroupPermissions['staff']['movefile'] = true;
$wgGroupPermissions['staff']['move-rootuserpages'] = true;
$wgGroupPermissions['staff']['move-subpages'] = true;
$wgGroupPermissions['staff']['editcontentmodel'] = true;
$wgGroupPermissions['staff']['editsemiprotected'] = true;
$wgGroupPermissions['staff']['comment'] = true;
$wgGroupPermissions['staff']['editinterface'] = true;
$wgGroupPermissions['staff']['replacetext'] = true;
$wgGroupPermissions['staff']['abusefilter-view-private'] = true;
$wgGroupPermissions['staff']['abusefilter-log-private'] = true;
//封禁权限调整
$wgSharedTables [] = 'ipblocks' ; // 全域共享封禁表单
$wgGroupPermissions['patroller']['block'] = true; // 由于前一条调整,实质上已允许巡查姬在全域进行封禁、解封,故直接增加权限以同步。
// 完成后可选择彻底移除 Extension:GlobalBlocking和涉及globalblock、globalblock-exempt、globalblock-whitelist的所有权限。
//这里是Grant而不是Group,一般用于[[Special:BotPasswords]],显示于[[Special:ListGrants]]
$wgGrantPermissions['editpage']['editcontentmodel'] = true; // 升级至MW1.35+后移除
$wgGrantPermissions['mergehistory']['mergehistory'] = true; // mergehistory授权组,升级至MW1.35+后移除
$wgGrantPermissions['oversight']['suppressrevision'] = true; // oversight授权组,升级至MW1.33+后移除
$wgGrantPermissions['oversight']['abusefilter-hide-log'] = true; // oversight授权组,升级至MW1.33+后移除
$wgGrantPermissions['hideusers']['hideuser'] = true; // 允许监督员使用全自动脚本隐藏用户,快速处理全域违规用户名的编辑历史
//历史遗留问题
$wgCascadingRestrictionLevels 数组中移除 patrolleredit // 错误的配置项,级联保护基于protect权限而非相关编辑权限
$wgGroupPermissions['sysop']['passwordreset'] = true; 删除本行 // 已废弃扩展的权限,https://www.mediawiki.org/w/index.php?oldid=1802259
第四次修订
//允许sysop新增、移除file-maintainer
$wgAddGroups['sysop'] 数组中添加 file-maintainer
$wgRemoveGroups['sysop'] 数组中添加 file-maintainer
//允许techeditor、scripteditor覆盖文件
$wgGroupPermissions['techeditor']['reupload'] = true;
$wgGroupPermissions['scripteditor']['reupload'] = true;
//新增file-maintainer用户组
$wgGroupPermissions['file-maintainer']['reupload'] = true; //全域
$wgGroupPermissions['file-maintainer']['suppressredirect'] = true; //仅共享站添加
$wgGroupPermissions['file-maintainer']['noratelimit'] = true; //仅共享站添加
$wgGroupsRemoveFromSelf['file-maintainer'] = array( 'file-maintainer' ); // 全域
//删除suppress的重复权限
$wgGroupPermissions['suppress']['commentadmin'] = true;
//补全suppress和bot的基础权限
$wgGroupPermissions['suppress']['delete'] = true;
$wgGroupPermissions['suppress']['bigdelete'] = true;
$wgGroupPermissions['suppress']['browsearchive'] = true;
$wgGroupPermissions['suppress']['deletedtext'] = true;
$wgGroupPermissions['suppress']['deletedhistory'] = true;
$wgGroupPermissions['suppress']['undelete'] = true;
$wgGroupPermissions['suppress']['abusefilter-log-detail'] = true;
$wgGroupPermissions['suppress']['abusefilter-log-private'] = true;
$wgGroupPermissions['suppress']['block'] = true;
$wgGroupPermissions['suppress']['blockemail'] = true;
$wgGroupPermissions['bot']['move'] = true;
$wgGroupPermissions['bot']['movefile'] = true;
$wgGroupPermissions['bot']['move-rootuserpages'] = true;
$wgGroupPermissions['bot']['move-subpages'] = true;
$wgGroupPermissions['bot']['move-categorypages'] = true;
//这里是Grant而不是Group,一般用于[[Special:BotPasswords]],显示于[[Special:ListGrants]],补全
$wgGrantPermissions['editwidgets']['editwidgets'] = true; // 允许机器人调整widget
$wgGrantPermissions['editprotected']['override-antispoof'] = true; // 允许机器人绕过antispoof编辑页面
$wgGrantPermissions['editprotected']['tboverride'] = true; // 允许机器人编辑黑名单保护的页面
$wgGrantPermissions['editprotected']['techedit'] = true; // 允许机器人编辑技术保护的页面
$wgGrantPermissions['createaccount']['tboverride-account'] = true; // 允许API创建账户绕过titleblacklist
$wgGrantPermissions['createaccount']['override-antispoof'] = true; // 允许API创建账户绕过antispoof
$wgGrantPermissions['blockusers']['hideuser'] = true; // 合并授权组至blockusers,请删除上次添加的$wgGrantPermissions['hideusers']['hideuser'] = true;
第五次修订
- 进度:除了(所有)组的abusefilter和保护等级外已实装。
// 所有调整均为全域
// Rights相关
// (*)用户组
$wgGroupPermissions['*']['abusefilter-log'] = false; // 或是将true行移除
$wgGroupPermissions['*']['abusefilter-view'] = false; // 或是将true行移除
$wgGroupPermissions['*']['abusefilter-log-detail'] = false; // 或是将true行移除
// autoconfirmed用户组
$wgGroupPermissions['autoconfirmed']['abusefilter-log'] = true;
$wgGroupPermissions['autoconfirmed']['abusefilter-view'] = true;
$wgGroupPermissions['autoconfirmed']['abusefilter-log-detail'] = true;
// extendedconfirmed权限
$wgGroupPermissions['extendedconfirmed']['extendedconfirmed'] = true;
$wgGroupPermissions['patroller']['extendedconfirmed'] = true;
$wgGroupPermissions['sysop']['extendedconfirmed'] = true;
$wgGroupPermissions['staff']['extendedconfirmed'] = true;
$wgGroupPermissions['bot']['extendedconfirmed'] = true;
$wgAddGroups['sysop'] 数组中添加 extendedconfirmed
$wgRemoveGroups['sysop'] 数组中添加 extendedconfirmed
// reupload-own权限
$wgGroupPermissions['goodeditor']['reupload-own'] = true;
$wgGroupPermissions['honoredmaintainer']['reupload-own'] = true;
// Grants相关
$wgGrantPermissions['hideusers']['hideuser'] = true; // 将这行删除,hideuser重复被分配到多个组
$wgGrantPermissions['editprotected']['extendedconfirmed'] = true; // 把extendedconfirmed放到editprotected组中
// Autopromote相关
// 删除原自确授权的$wgAutoConfirmCount、$wgAutoConfirmAge相关行并写入下列内容(for mw1.38+)
$wgAutopromote = [
'autoconfirmed' => ['&',
[APCOND_EDITCOUNT, 10],
[APCOND_AGE_FROM_EDIT, 3*86400],
],
];
// 延确只在编辑时授权一次
$wgAutopromoteOnce = [
'onEdit' => [
'extendedconfirmed' => ['&',
[APCOND_EDITCOUNT, 500],
[APCOND_AGE_FROM_EDIT, 90*86400],
],
],
];
// ProtectLevel相关
$wgRestrictionLevels[] = 'extendedconfirmed';
// 能不能一并把[[User:星海子/List]]里的也一起实装