mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Add permission check to canDownload() in
MessageAttachmentObjectType.class.php
This commit is contained in:
parent
b99a625a36
commit
d94a73c9b0
@ -37,15 +37,15 @@ public function getMaxCount() {
|
||||
* @see wcf\system\attachment\IAttachmentObjectType::canDownload()
|
||||
*/
|
||||
public function canDownload($objectID) {
|
||||
// TODO get the room ID
|
||||
/*if ($objectID) {
|
||||
$room = \chat\data\room\RoomCache::getInstance()->getRoom($objectID);
|
||||
if ($room && $room->canEnter()) return true;
|
||||
if ($objectID) {
|
||||
$message = new \chat\data\message\Message($objectID);
|
||||
if (isset($message->roomID) && $message->roomID) {
|
||||
$room = \chat\data\room\RoomCache::getInstance()->getRoom($message->roomID);
|
||||
if ($room && $room->canEnter()) return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;*/
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function canPreview($objectID) {
|
||||
@ -68,7 +68,6 @@ public function canUpload($objectID, $parentObjectID = 0) {
|
||||
* @see wcf\system\attachment\IAttachmentObjectType::canDelete()
|
||||
*/
|
||||
public function canDelete($objectID) {
|
||||
// TODO Allow attachments to be deleted in ACP
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user