From c7545b5e9e1d281e14bb3368667c49480e248964 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 19:16:07 +0000 Subject: [PATCH] Monotone-Parent: eb2a31ca341c6716a5121507df99f820e15f17f2 Monotone-Revision: c204736a5f5dcfce7b1fd9db8327cbe1ff79c7aa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T19:16:07 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/Appointments/SOGoAppointmentFolder.m | 9 --------- SoObjects/Mailer/SOGoMailFolder.m | 16 ++++++++-------- SoObjects/SOGo/SOGoFolder.m | 6 ------ SoObjects/SOGo/SOGoObject.h | 1 - SoObjects/SOGo/SOGoObject.m | 7 ------- UI/Common/UIxUserRightsEditor.m | 5 ----- 7 files changed, 11 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index b82665af8..666e9294d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-22 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -defaultAclRoles]): + removed method. + * SoObjects/SOGo/SOGoPermissions.m: added the new role "SOGoMailRole_MessageEraser". diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 5d708c38f..a2cea22ac 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1296,13 +1296,4 @@ static NSNumber *sharedYes = nil; return @"IPF.Appointment"; } -/* acls */ -- (NSArray *) defaultAclRoles -{ - return [NSArray arrayWithObjects: - SOGoCalendarRole_PublicViewer, - SOGoCalendarRole_ConfidentialDAndTViewer, - nil]; -} - @end /* SOGoAppointmentFolder */ diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index b44cbf448..ba69e9993 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -39,6 +39,8 @@ #import "SOGoMailFolderDataSource.h" #import "SOGoMailFolder.h" +static NSString *defaultUserID = @"anyone"; + @implementation SOGoMailFolder static BOOL useAltNamespace = NO; @@ -428,16 +430,14 @@ static BOOL useAltNamespace = NO; - (NSArray *) aclsForUser: (NSString *) uid { NSDictionary *imapAcls; + NSArray *userAcls; imapAcls = [imap4 aclForMailboxAtURL: [self imap4URL]]; + userAcls = [imapAcls objectForKey: uid]; + if (!([userAcls count] || [uid isEqualToString: defaultUserID])) + userAcls = [imapAcls objectForKey: defaultUserID]; - return [self _imapAclsToSOGoAcls: [imapAcls objectForKey: uid]]; -} - -- (NSArray *) defaultAclRoles -{ - return [NSArray arrayWithObjects: SOGoRole_ObjectViewer, - SOGoRole_ObjectReader, SOGoMailRole_SeenKeeper, nil]; + return [self _imapAclsToSOGoAcls: userAcls]; } - (void) removeAclsForUsers: (NSArray *) users @@ -471,7 +471,7 @@ static BOOL useAltNamespace = NO; - (NSString *) defaultUserID { - return @"anyone"; + return defaultUserID; } - (BOOL) hasSupportForDefaultRoles diff --git a/SoObjects/SOGo/SOGoFolder.m b/SoObjects/SOGo/SOGoFolder.m index 82589842c..2e3b7469f 100644 --- a/SoObjects/SOGo/SOGoFolder.m +++ b/SoObjects/SOGo/SOGoFolder.m @@ -422,12 +422,6 @@ static NSString *defaultUserID = @""; } /* acls */ -- (NSArray *) defaultAclRoles -{ -#warning this should be changed to something useful - return nil; -} - - (NSArray *) aclUsers { return [self aclUsersForObjectAtPath: [self pathArrayToSoObject]]; diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index a90fdde78..b265699ef 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -98,7 +98,6 @@ /* acls */ -- (NSArray *) defaultAclRoles; - (NSArray *) aclUsers; - (NSArray *) aclsForUser: (NSString *) uid; - (void) setRoles: (NSArray *) roles diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 27ea92d1f..5ca5809f7 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -719,13 +719,6 @@ static BOOL kontactGroupDAV = YES; return nil; } -- (NSArray *) defaultAclRoles -{ - [self subclassResponsibility: _cmd]; - - return nil; -} - - (void) setRoles: (NSArray *) roles forUser: (NSString *) uid { diff --git a/UI/Common/UIxUserRightsEditor.m b/UI/Common/UIxUserRightsEditor.m index 10b1be909..4146b30da 100644 --- a/UI/Common/UIxUserRightsEditor.m +++ b/UI/Common/UIxUserRightsEditor.m @@ -80,7 +80,6 @@ NSString *newUID; LDAPUserManager *um; SOGoObject *clientObject; - unsigned int count; response = NO; @@ -97,10 +96,6 @@ ASSIGN (uid, newUID); clientObject = [self clientObject]; [userRights addObjectsFromArray: [clientObject aclsForUser: uid]]; - count = [userRights count]; - if (!count || (count == 1 && [[userRights objectAtIndex: 0] - isEqualToString: SOGoRole_None])) - [userRights setArray: [clientObject defaultAclRoles]]; response = YES; }