<categoryname>user.message</categoryname>
<optiontype>BBCodeSelect</optiontype>
</option>
+ <option name="user.message.canMentionGroups">
+ <categoryname>user.message</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ </option>
<!-- /user.message -->
<!-- user.message.comment -->
<option name="user.comment.floodControlTime">
$list = [];
if ($this->parameters['data']['includeUserGroups']) {
- $accessibleGroups = UserGroup::getAccessibleGroups();
+ $accessibleGroups = UserGroup::getMentionableGroups();
foreach ($accessibleGroups as $group) {
if (!empty($this->parameters['data']['restrictUserGroupIDs']) && !in_array($group->groupID, $this->parameters['data']['restrictUserGroupIDs'])) {
continue;
}
- if ($this->parameters['data']['scope'] === 'mention' && !$group->canBeMentioned()) {
+ if ($this->parameters['data']['scope'] === 'mention' && (!WCF::getSession()->getPermission('user.message.canMentionGroups') || !$group->canBeMentioned())) {
continue;
}
* @since 5.2
*/
public static function getMentionableGroups() {
+ if (!WCF::getSession()->getPermission('user.message.canMentionGroups')) {
+ return [];
+ }
+
self::getCache();
$groups = [];
if ($type === 'user') {
$usernames[] = $element->textContent;
}
- else if ($type === 'group') {
+ else if ($type === 'group' && WCF::getSession()->getPermission('user.message.canMentionGroups')) {
$attributes = $htmlInputProcessor->getHtmlInputNodeProcessor()->parseAttributes(
$element->getAttribute('data-attributes')
);
<item name="wcf.acp.group.option.user.comment.disallowedBBCodes.description"><![CDATA[Die hier ausgewählten BBCodes dürfen von Mitgliedern dieser Benutzergruppe <em>nicht</em> verwendet werden.]]></item>
<item name="wcf.acp.group.option.user.message.disallowedBBCodes"><![CDATA[Nicht erlaubte BBCodes]]></item>
<item name="wcf.acp.group.option.user.message.disallowedBBCodes.description"><![CDATA[Die hier ausgewählten BBCodes dürfen von Mitgliedern dieser Benutzergruppe <em>nicht</em> verwendet werden.]]></item>
+ <item name="wcf.acp.group.option.user.message.canMentionGroups"><![CDATA[Kann Benutzergruppen erwähnen]]></item>
<item name="wcf.acp.group.option.admin.user.rank.canManageRank"><![CDATA[Kann Benutzerränge verwalten]]></item>
<item name="wcf.acp.group.option.admin.user.canEditActivityPoints"><![CDATA[Kann Aktivitätspunkte bearbeiten]]></item>
<item name="wcf.acp.group.option.admin.user.canViewInvisible"><![CDATA[Kann unsichtbare Benutzer sehen]]></item>
<item name="wcf.acp.group.option.user.comment.disallowedBBCodes.description"><![CDATA[Selected BBCodes <em>cannot</em> be used by the users of this user group.]]></item>
<item name="wcf.acp.group.option.user.message.disallowedBBCodes"><![CDATA[Disallowed BBCodes]]></item>
<item name="wcf.acp.group.option.user.message.disallowedBBCodes.description"><![CDATA[Selected BBCodes <em>cannot</em> be used by the users of this user group.]]></item>
+ <item name="wcf.acp.group.option.user.message.canMentionGroups"><![CDATA[Can mention user groups]]></item>
<item name="wcf.acp.group.option.admin.user.rank.canManageRank"><![CDATA[Can manage user ranks]]></item>
<item name="wcf.acp.group.option.admin.user.canEditActivityPoints"><![CDATA[Can manage activity points]]></item>
<item name="wcf.acp.group.option.admin.user.canViewInvisible"><![CDATA[Can view invisible users]]></item>