skip application update if user has no RUN right
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 11 May 2017 06:33:45 +0000 (08:33 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 11 May 2017 12:50:03 +0000 (14:50 +0200)
... in node/container acl migration update

Change-Id: I50f31c3a0b46a5a540eb346295a1300325a396c8
Reviewed-on: http://gerrit.tine20.com/customers/4651
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Setup/Update/Release10.php

index 0e1a0f1..d8cf122 100644 (file)
@@ -766,13 +766,20 @@ class Tinebase_Setup_Update_Release10 extends Setup_Update_Abstract
      */
     public function update_16()
     {
-        //
         $applications = Tinebase_Application::getInstance()->getApplications();
         $setupUser = Setup_Update_Abstract::getSetupFromConfigOrCreateOnTheFly();
         if ($setupUser) {
             Tinebase_Core::set(Tinebase_Core::USER, $setupUser);
         }
         foreach ($applications as $application) {
+            if ($setupUser && ! $setupUser->hasRight($application, Tinebase_Acl_Rights::RUN)) {
+                if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) {
+                    Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__
+                        . ' Skipping ' . $application->name . ' because setupuser has no RUN right');
+                }
+                continue;
+            }
+
             $this->_migrateAclForApplication($application, Tinebase_FileSystem::FOLDER_TYPE_PERSONAL);
             $this->_migrateAclForApplication($application, Tinebase_FileSystem::FOLDER_TYPE_SHARED);
         }