mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
(sogo-tool) Fix ACLs restore in single store mode
Fixes #4256 Fixes #4385 Fixes #4390
This commit is contained in:
1
NEWS
1
NEWS
@@ -7,6 +7,7 @@ Enhancements
|
||||
Bug fixes
|
||||
- [core] properly update the last-modified attribute (#4313)
|
||||
- [core] fixed default data value for c_hascertificate (#4442)
|
||||
- [core] fixed ACLs restoration with sogo-tool in single store mode (#4385)
|
||||
- [web] prevent deletion of special folders using del key
|
||||
- [web] fixed SAML2 session timeout handling during XHR requests
|
||||
- [web] fixed renaming a folder under iOS
|
||||
|
||||
@@ -1650,11 +1650,13 @@ andAttribute: (EOAttribute *)_attribute
|
||||
sql = [NSMutableString stringWithCapacity:256];
|
||||
[sql appendString:@"DELETE FROM "];
|
||||
[sql appendString:[self aclTableName]];
|
||||
if ([GCSFolderManager singleStoreMode])
|
||||
[sql appendFormat:@" WHERE c_folder_id = %@", folderId];
|
||||
qSql = [self _sqlForQualifier: [_fs qualifier]];
|
||||
if (qSql)
|
||||
{
|
||||
if ([GCSFolderManager singleStoreMode])
|
||||
[sql appendFormat:@" WHERE c_folder_id = %@ AND (%@)", folderId, qSql];
|
||||
[sql appendFormat:@" AND (%@)", qSql];
|
||||
else
|
||||
[sql appendFormat:@" WHERE %@", qSql];
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user