Skip to content

Commit

Permalink
fix(acls): fix SQL conversion for LIKE operator to find groups
Browse files Browse the repository at this point in the history
Fixes #5492
  • Loading branch information
cgx committed Mar 28, 2022
1 parent 97e8f08 commit 3140a9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SoObjects/SOGo/SOGoGCSFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -1659,8 +1659,9 @@ - (NSArray *) _fetchAclsForUser: (NSString *) uid
NSArray *records, *acls;
NSString *qs;

// We look for the exact uid or any uid that begins with "@" (corresponding to groups)
qs = [NSString stringWithFormat: @"(c_object = '/%@') AND (c_uid = '%@' OR c_uid LIKE '@%%')",
// We look for the exact uid or any uid that begins with "@" (corresponding to groups).
// Notice that we use a wildcard operator that will be converted to SQL in [EOQualifier+GCS _appendKeyValueQualifier:withAdaptor:toString:]
qs = [NSString stringWithFormat: @"(c_object = '/%@') AND (c_uid = '%@' OR c_uid LIKE '@*')",
objectPath, uid];
qualifier = [EOQualifier qualifierWithQualifierFormat: qs];
records = [[self ocsFolder] fetchAclMatchingQualifier: qualifier];
Expand Down

0 comments on commit 3140a9d

Please sign in to comment.