Skip to content

Commit

Permalink
fix(core): added even better debugging for bogus groups
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Jun 3, 2020
1 parent 8f7df73 commit 9f55cdc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions SoObjects/SOGo/SOGoGCSFolder.m
Expand Up @@ -956,7 +956,7 @@ - (BOOL) subscribeUserOrGroup: (NSString *) theIdentifier
}
else
{
[self errorWithFormat: @"Inconsistency error - got group identifier (%@) from a source (%@) that does not support groups.", theIdentifier, [dict objectForKey: @"SOGoSource"]];
[self errorWithFormat: @"Inconsistency (subscribeUserOrGroup:reallyDo:response:) error - got group identifier (%@) from a source (%@) that does not support groups (%@).", theIdentifier, [dict objectForKey: @"SOGoSource"], NSStringFromClass([source class])];
return NO;
}
}
Expand Down Expand Up @@ -1651,15 +1651,19 @@ - (NSArray *) _aclsFromGroupRoles: (NSArray *) records
inDomain: domain];
if (dict)
{
id <SOGoSource> source = [[SOGoUserManager sharedUserManager] sourceWithID: [dict objectForKey: @"SOGoSource"]];
if ([source conformsToProtocol:@protocol(SOGoMembershipSource)] &&
[(id<SOGoMembershipSource>)(source) groupWithUIDHasMemberWithUID: currentUID memberUid: uid])
id <SOGoSource> source;

source = [[SOGoUserManager sharedUserManager] sourceWithID: [dict objectForKey: @"SOGoSource"]];
if ([source conformsToProtocol:@protocol(SOGoMembershipSource)])
{
[acls addObject: [record valueForKey: @"c_role"]];
if ([(id<SOGoMembershipSource>)(source) groupWithUIDHasMemberWithUID: currentUID memberUid: uid])
[acls addObject: [record valueForKey: @"c_role"]];
else
[self errorWithFormat: @"Group %@ has no member with UID %@", currentUID, uid];
}
else
{
[self errorWithFormat: @"Inconsistency error - got group identifier (%@) from a source (%@) that does not support groups.", currentUID, [dict objectForKey: @"SOGoSource"]];
[self errorWithFormat: @"Inconsistency (_aclsFromGroupRoles:matchingUID:) error - got group identifier (%@) from a source (%@) that does not support groups (%@).", currentUID, [dict objectForKey: @"SOGoSource"], NSStringFromClass([source class])];
return [NSArray array];
}
}
Expand Down Expand Up @@ -1812,7 +1816,7 @@ - (void) removeAclsForUsers: (NSArray *) users
}
else
{
[self errorWithFormat: @"Inconsistency error - got group identifier (%@) from a source (%@) that does not support groups (%@).", uid, [dict objectForKey: @"SOGoSource"], NSStringFromClass([source class])];
[self errorWithFormat: @"Inconsistency error (removeAclsForUsers:forObjectAtPath:) - got group identifier (%@) from a source (%@) that does not support groups (%@).", uid, [dict objectForKey: @"SOGoSource"], NSStringFromClass([source class])];
return;
}
}
Expand Down

0 comments on commit 9f55cdc

Please sign in to comment.