(sogo-tool) Fix ACLs restore in single store mode

Fixes #4256
Fixes #4385
Fixes #4390
This commit is contained in:
Francis Lachapelle committed 2018-04-27 12:36:40 -04:00
1 parent b8958b931e
commit f31892044b
3 files changed
+16 -6

No files matched your search

+12 -5
View File
@@ -348,11 +348,18 @@
userRoles = [[acl objectForKey: currentUser] objectEnumerator];
while ((currentRole = [userRoles nextObject]))
{
SQL = [NSString stringWithFormat: @"INSERT INTO %@"
@" (c_object, c_uid, c_role)"
@" VALUES ('%@', '%@', '%@')",
aclTableName,
folderPath, currentUser, currentRole];
if ([GCSFolderManager singleStoreMode])
SQL = [NSString stringWithFormat: @"INSERT INTO %@"
@" (c_object, c_uid, c_role, c_folder_id)"
@" VALUES ('%@', '%@', '%@', %@)",
aclTableName,
folderPath, currentUser, currentRole, [gcsFolder folderId]];
else
SQL = [NSString stringWithFormat: @"INSERT INTO %@"
@" (c_object, c_uid, c_role)"
@" VALUES ('%@', '%@', '%@')",
aclTableName,
folderPath, currentUser, currentRole];
[channel evaluateExpressionX: SQL];
}
}