Commit 2d399df7 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1027 Switch stores before checking permissions on move destination

folder.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 947dfb3f
...@@ -397,7 +397,10 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -397,7 +397,10 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
// When we setup the $current importer, we didn't know what we needed to do, so we look only at the src folder for permissions. // When we setup the $current importer, we didn't know what we needed to do, so we look only at the src folder for permissions.
// Now the $newfolder could be read only as well. So we need to check it's permissions and then switch to a ReplyBackImExporter if it's r/o. // Now the $newfolder could be read only as well. So we need to check it's permissions and then switch to a ReplyBackImExporter if it's r/o.
if (!$this->isReplyBackExporter()) { if (!$this->isReplyBackExporter()) {
if (!self::$backend->HasSecretaryACLs($this->store, $newfolder)) {
// check if the user has permissions on the destination folder
$dststore = self::$backend->GetMAPIStoreForFolderId(ZPush::GetAdditionalSyncFolderStore($newfolder), $newfolder);
if (!self::$backend->HasSecretaryACLs($dststore, $newfolder)) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("KopanoChangesWrapper->ImportMessageMove(): destination folderid '%s' is missing permissions. Switching to ReplyBackImExporter.", Utils::PrintAsString($newfolder))); ZLog::Write(LOGLEVEL_DEBUG, sprintf("KopanoChangesWrapper->ImportMessageMove(): destination folderid '%s' is missing permissions. Switching to ReplyBackImExporter.", Utils::PrintAsString($newfolder)));
$this->replyback = $this->getReplyBackImExporter(); $this->replyback = $this->getReplyBackImExporter();
$this->current = $this->replyback; $this->current = $this->replyback;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment