Use application context when initialising quick tables ACLs

As the stored context from initialisation may have changed
by `setContext` by other operations when acting as a OpenChange
library. This would make having a login set to nil and forcing
a NSException when it attempts to set a nil key at
[SOGoAppointmentFolder:roleForComponentsWithAccessClass:forUser]
inside [SOGoAppointmentFolder:initializeQuickTablesAclsInContext].
This commit is contained in:
Enrique J. Hernández Blasco 2015-10-29 23:10:22 +01:00
parent e0d49d2407
commit 77bba8e5ea

View file

@ -604,8 +604,16 @@ static Class iCalEventK = nil;
NSNumber *classNumber;
unsigned int grantedCount;
iCalAccessClass currentClass;
WOContext *localContext;
[self initializeQuickTablesAclsInContext: context];
/* FIXME: The stored context from initialisation may have changed
by setContext by other operations in OpenChange library,
so we keep tighly to use the current session one. Without
this, the login is set to nil and a NSException is raised
at [SOGoAppointmentFolder:roleForComponentsWithAccessClass:forUser]
inside [SOGoAppointmentFolder:initializeQuickTablesAclsInContext]. */
localContext = [[WOApplication application] context];
[self initializeQuickTablesAclsInContext: localContext];
grantedClasses = [NSMutableArray arrayWithCapacity: 3];
deniedClasses = [NSMutableArray arrayWithCapacity: 3];
for (currentClass = 0;