9894: Tinebase_WebDav_Root::__construct should check all installed apps
authorLars Kneschke <l.kneschke@metaways.de>
Thu, 1 May 2014 03:06:43 +0000 (05:06 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:26:35 +0000 (11:26 +0200)
for $app_Frontend_WebDAV

* check for all app the the user has the RUN right for
* check for $app_Frontend_WebDAV
* add class to webdav node

Change-Id: I6f8377ba0debdcd19ff657407f40866136a4d639
Task-Url: https://forge.tine20.org/mantisbt/view.php?id=9894
Reviewed-on: http://gerrit.tine20.com/customers/592
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/WebDav/Root.php

index 0a909e0..2bd43de 100644 (file)
@@ -59,10 +59,10 @@ class Tinebase_WebDav_Root extends \Sabre\DAV\SimpleCollection
         // webdav tree
         $webDAVCollection = new \Sabre\DAV\SimpleCollection('webdav');
         
-        foreach (array('Addressbook', 'Calendar', 'Tasks', 'Felamimail', 'Filemanager') as $application) {
-            $applicationClass = $application . '_Frontend_WebDAV';
-            if (Tinebase_Core::getUser()->hasRight($application, Tinebase_Acl_Rights::RUN) && class_exists($applicationClass)) {
-                $webDAVCollection->addChild(new $applicationClass($application));
+        foreach (Tinebase_Core::getUser()->getApplications() as $application) {
+            $applicationClass = $application->name . '_Frontend_WebDAV';
+            if (class_exists($applicationClass)) {
+                $webDAVCollection->addChild(new $applicationClass($application->name));
             }
         }