Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
mailsecuritycontext.php
1<?php
2
4
7use Bitrix\Disk;
8
9if (!Main\Loader::includeModule('disk'))
10{
11 return false;
12}
13
14class MailSecurityContext extends Disk\Security\SecurityContext
15{
16
21 public function canAdd($targetId)
22 {
23 return true;
24 }
25
30 public function canChangeRights($objectId)
31 {
32 return false;
33 }
34
39 public function canChangeSettings($objectId)
40 {
41 return false;
42 }
43
48 public function canCreateWorkflow($objectId)
49 {
50 return false;
51 }
52
57 public function canDelete($objectId)
58 {
59 return false;
60 }
61
66 public function canMarkDeleted($objectId)
67 {
68 return false;
69 }
70
76 public function canMove($objectId, $targetId)
77 {
78 return false;
79 }
80
85 public function canRead($objectId)
86 {
87 global $DB;
88
89 $message = $DB->query(sprintf(
90 'SELECT ID, MAILBOX_ID FROM b_mail_message WHERE ID IN (
91 SELECT MESSAGE_ID FROM b_mail_msg_attachment WHERE FILE_ID = (
92 SELECT FILE_ID FROM b_disk_object WHERE ID = %u
93 )
94 )',
95 $objectId
96 ))->fetch();
97
98 return Mail\Helper\Message::hasAccess($message, $this->userId);
99 }
100
105 public function canRename($objectId)
106 {
107 return false;
108 }
109
114 public function canRestore($objectId)
115 {
116 return false;
117 }
118
123 public function canShare($objectId)
124 {
125 return false;
126 }
127
132 public function canUpdate($objectId)
133 {
134 return false;
135 }
136
141 public function canStartBizProc($objectId)
142 {
143 return false;
144 }
145
146 public function getSqlExpressionForList($columnObjectId, $columnCreatedBy)
147 {
148 return '1 = 0';
149 }
150
151}
getSqlExpressionForList($columnObjectId, $columnCreatedBy)