<optiontype>boolean</optiontype>
<defaultvalue>1</defaultvalue>
</option>
-
<option name="user.profileComment.canEditComment">
<categoryname>user.profileComment</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>1</defaultvalue>
</option>
-
<option name="user.profileComment.canDeleteComment">
<categoryname>user.profileComment</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
<admindefaultvalue>1</admindefaultvalue>
</option>
+ <option name="user.profileComment.canDeleteCommentInOwnProfile">
+ <categoryname>user.profileComment</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>0</defaultvalue>
+ </option>
<!-- /user.profileComment -->
<option name="admin.content.label.canManageLabel">
$this->responseIDs[] = $responseID;
$responseIDs[$responseID] = $comment->commentID;
}
-
+
if ($comment->userID) {
$userIDs[] = $comment->userID;
}
<?php
namespace wcf\system\comment\manager;
+use wcf\data\comment\response\CommentResponse;
+use wcf\data\comment\Comment;
use wcf\data\user\UserProfile;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
/**
* @see \wcf\system\comment\manager\ICommentManager::updateCounter()
*/
- public function updateCounter($objectID, $value) { }
+ public function updateCounter($objectID, $value) {
+ // does nothing
+ }
+
+ /**
+ * @see \wcf\system\comment\manager\ICommentManager::canDeleteComment()
+ */
+ public function canDeleteComment(Comment $comment) {
+ if ($comment->objectID == WCF::getUser()->userID && WCF::getSession()->getPermission('user.profileComment.canDeleteCommentInOwnProfile')) {
+ return true;
+ }
+
+ return parent::canDeleteComment($comment);
+ }
+
+ /**
+ * @see \wcf\system\comment\manager\ICommentManager::canDeleteResponse()
+ */
+ public function canDeleteResponse(CommentResponse $response) {
+ if ($response->getComment()->objectID == WCF::getUser()->userID && WCF::getSession()->getPermission('user.profileComment.canDeleteCommentInOwnProfile')) {
+ return true;
+ }
+
+ return parent::canDeleteResponse($response);
+ }
}
<item name="wcf.acp.group.option.user.profileComment.canAddComment"><![CDATA[Kann Pinnwand-Kommentare erstellen]]></item>
<item name="wcf.acp.group.option.user.profileComment.canEditComment"><![CDATA[Kann eigene Pinnwand-Kommentare bearbeiten]]></item>
<item name="wcf.acp.group.option.user.profileComment.canDeleteComment"><![CDATA[Kann eigene Pinnwand-Kommentare löschen]]></item>
+ <item name="wcf.acp.group.option.user.profileComment.canDeleteCommentInOwnProfile"><![CDATA[Kann Kommentare an der eigenen Pinnwand löschen]]></item>
<item name="wcf.acp.group.option.mod.profileComment.canEditComment"><![CDATA[Kann Pinnwand-Kommentare bearbeiten]]></item>
<item name="wcf.acp.group.option.mod.profileComment.canDeleteComment"><![CDATA[Kann Pinnwand-Kommentare löschen]]></item>
<item name="wcf.acp.group.option.mod.profileComment.canModerateComment"><![CDATA[Kann Pinnwand-Kommentare moderieren]]></item>
<item name="wcf.acp.group.option.user.profileComment.canAddComment"><![CDATA[Can create comments]]></item>
<item name="wcf.acp.group.option.user.profileComment.canEditComment"><![CDATA[Can edit own comments]]></item>
<item name="wcf.acp.group.option.user.profileComment.canDeleteComment"><![CDATA[Can delete own comments]]></item>
+ <item name="wcf.acp.group.option.user.profileComment.canDeleteCommentInOwnProfile"><![CDATA[Can delete comments on their own wall]]></item>
<item name="wcf.acp.group.option.mod.profileComment.canEditComment"><![CDATA[Can edit comments]]></item>
<item name="wcf.acp.group.option.mod.profileComment.canDeleteComment"><![CDATA[Can delete comments]]></item>
<item name="wcf.acp.group.option.mod.profileComment.canModerateComment"><![CDATA[Can moderate comments]]></item>