|
12 | 12 | use OCA\DAV\CalDAV\CalendarHome; |
13 | 13 | use OCA\DAV\CalDAV\Publishing\Xml\Publisher; |
14 | 14 | use OCP\AppFramework\Http; |
| 15 | +use OCP\IAppConfig; |
15 | 16 | use OCP\IConfig; |
16 | 17 | use OCP\IURLGenerator; |
17 | 18 | use Sabre\CalDAV\Xml\Property\AllowedSharingModes; |
@@ -48,6 +49,7 @@ public function __construct( |
48 | 49 | * URL Generator for absolute URLs. |
49 | 50 | */ |
50 | 51 | protected IURLGenerator $urlGenerator, |
| 52 | + private IAppConfig $appConfig, |
51 | 53 | ) { |
52 | 54 | } |
53 | 55 |
|
@@ -126,7 +128,7 @@ public function propFind(PropFind $propFind, INode $node) { |
126 | 128 | $canShare = (!$node->isSubscription() && $node->canWrite()); |
127 | 129 | $canPublish = (!$node->isSubscription() && $node->canWrite()); |
128 | 130 |
|
129 | | - if ($this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes') { |
| 131 | + if ($this->appConfig->getValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes') { |
130 | 132 | $canShare = $canShare && ($node->getOwner() === $node->getPrincipalURI()); |
131 | 133 | $canPublish = $canPublish && ($node->getOwner() === $node->getPrincipalURI()); |
132 | 134 | } |
@@ -190,7 +192,7 @@ public function httpPost(RequestInterface $request, ResponseInterface $response) |
190 | 192 | /** @var \Sabre\DAVACL\Plugin $acl */ |
191 | 193 | $acl->checkPrivileges($path, '{DAV:}write'); |
192 | 194 |
|
193 | | - $limitSharingToOwner = $this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; |
| 195 | + $limitSharingToOwner = $this->appConfig->getValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; |
194 | 196 | $isOwner = $acl->getCurrentUserPrincipal() === $node->getOwner(); |
195 | 197 | if ($limitSharingToOwner && !$isOwner) { |
196 | 198 | return; |
@@ -224,7 +226,7 @@ public function httpPost(RequestInterface $request, ResponseInterface $response) |
224 | 226 | /** @var \Sabre\DAVACL\Plugin $acl */ |
225 | 227 | $acl->checkPrivileges($path, '{DAV:}write'); |
226 | 228 |
|
227 | | - $limitSharingToOwner = $this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; |
| 229 | + $limitSharingToOwner = $this->appConfig->getValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; |
228 | 230 | $isOwner = $acl->getCurrentUserPrincipal() === $node->getOwner(); |
229 | 231 | if ($limitSharingToOwner && !$isOwner) { |
230 | 232 | return; |
|
0 commit comments