78 $out->addModuleStyles(
'mediawiki.special' );
79 $this->
addHelpLink(
'Help:User_rights_and_groups' );
81 $out->wrapWikiMsg(
"<div class=\"mw-listgrouprights-key\">\n$1\n</div>",
'listgrouprights-key' );
84 Xml::openElement(
'table', [
'class' =>
'wikitable mw-listgrouprights-table' ] ) .
86 Xml::element(
'th',
null, $this->
msg(
'listgrouprights-group' )->text() ) .
87 Xml::element(
'th',
null, $this->
msg(
'listgrouprights-rights' )->text() ) .
92 $addGroups = $config->get( MainConfigNames::AddGroups );
93 $removeGroups = $config->get( MainConfigNames::RemoveGroups );
94 $groupsAddToSelf = $config->get( MainConfigNames::GroupsAddToSelf );
95 $groupsRemoveFromSelf = $config->get( MainConfigNames::GroupsRemoveFromSelf );
96 $allGroups = array_merge(
97 $this->userGroupManager->listAllGroups(),
98 $this->userGroupManager->listAllImplicitGroups()
105 foreach ( $allGroups as $group ) {
106 $permissions = $this->groupPermissionsLookup->getGrantedPermissions( $group );
107 $groupname = ( $group ==
'*' )
111 $groupnameLocalized =
$lang->getGroupName( $groupname );
113 $grouppageLocalizedTitle = UserGroupMembership::getGroupPage( $groupname )
114 ?: Title::makeTitleSafe(
NS_PROJECT, $groupname );
116 if ( $group ==
'*' || !$grouppageLocalizedTitle ) {
118 $grouppage = htmlspecialchars( $groupnameLocalized );
120 $grouppage = $linkRenderer->makeLink(
121 $grouppageLocalizedTitle,
126 if ( $group ===
'user' ) {
128 $grouplink =
'<br />' . $linkRenderer->makeKnownLink(
130 $this->
msg(
'listgrouprights-members' )->text()
132 } elseif ( !in_array( $group, $config->get( MainConfigNames::ImplicitGroups ) ) ) {
133 $grouplink =
'<br />' . $linkRenderer->makeKnownLink(
135 $this->
msg(
'listgrouprights-members' )->text(),
137 [
'group' => $group ]
144 $revoke = $this->groupPermissionsLookup->getRevokedPermissions( $group );
145 $addgroups = $addGroups[$group] ?? [];
146 $removegroups = $removeGroups[$group] ?? [];
147 $addgroupsSelf = $groupsAddToSelf[$group] ?? [];
148 $removegroupsSelf = $groupsRemoveFromSelf[$group] ?? [];
150 $id = $group ==
'*' ? false : Sanitizer::escapeIdForAttribute( $group );
151 $out->addHTML( Html::rawElement(
'tr', [
'id' => $id ],
"
152 <td>$grouppage$grouplink</td>
154 $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups,
155 $addgroupsSelf, $removegroupsSelf ) .
160 $out->addHTML( Xml::closeElement(
'table' ) );
161 $this->outputNamespaceProtectionInfo();
257 private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) {