From 4108411f2e403acd947c0b20fcc39ddab66753f2 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 17 Apr 2007 14:09:29 +0000 Subject: [PATCH] Monotone-Parent: e13aba14f9bcb6e2cbec65189340ac8704204778 Monotone-Revision: e2159d82254439aa0954efbb3e1730d45a41c2d6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-04-17T14:09:29 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/SOGo/SOGoObject.h | 11 ++++++++++- SoObjects/SOGo/SOGoObject.m | 38 +++++++++++++++++++++++++++++++++++-- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45fc4bcf2..14d5a8947 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2007-04-17 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -acls]): stub method + that requires overriding by subclasses. + ([SOGoObject -aclsForUser:uid]): idem. + ([SOGoObject -defaultAclRoles]): idem. + ([SOGoObject -setRoles:rolesforUser:uid]): idem. + ([SOGoObject -removeAclsForUsers:users]): idem. + * UI/Common/UIxObjectActions.m: new module implementing the web actions common to SOGoObject and all its subclasses. ([UIxObjectActions -addUserInAclsAction]): new method that adds a diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index b09b636cc..00d257bde 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -86,9 +86,18 @@ - (NSException *)matchesRequestConditionInContext:(id)_ctx; +/* acls */ + +- (NSString *) defaultAclRoles; +- (NSArray *) acls; +- (NSArray *) aclsForUser: (NSString *) uid; +- (void) setRoles: (NSString *) roles + forUser: (NSString *) uid; +- (void) removeAclsForUsers: (NSArray *) users; + /* description */ -- (void)appendAttributesToDescription:(NSMutableString *)_ms; +- (void) appendAttributesToDescription:(NSMutableString *)_ms; @end diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index a0be82859..2688f7659 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -26,6 +26,7 @@ #import #import #import +#import #import "common.h" @@ -34,7 +35,6 @@ #import "SOGoPermissions.h" #import "SOGoUser.h" -#import "SOGoAclsFolder.h" #import "SOGoAuthenticator.h" #import "SOGoUserFolder.h" @@ -354,7 +354,7 @@ static BOOL kontactGroupDAV = YES; NSDictionary *currentAcl; SoClassSecurityInfo *sInfo; - acls = [[[SOGoAclsFolder aclsFolder] aclsForObject: self] objectEnumerator]; + acls = [[self acls] objectEnumerator]; aclsDictionary = [NSMutableDictionary dictionary]; sInfo = [[self class] soClassSecurityInfo]; @@ -690,6 +690,40 @@ static BOOL kontactGroupDAV = YES; return nil; } +/* acls */ + +- (NSArray *) acls +{ + [self subclassResponsibility: _cmd]; + + return nil; +} + +- (NSArray *) aclsForUser: (NSString *) uid +{ + [self subclassResponsibility: _cmd]; + + return nil; +} + +- (NSString *) defaultAclRoles +{ + [self subclassResponsibility: _cmd]; + + return nil; +} + +- (void) setRoles: (NSString *) roles + forUser: (NSString *) uid +{ + [self subclassResponsibility: _cmd]; +} + +- (void) removeAclsForUsers: (NSArray *) users +{ + [self subclassResponsibility: _cmd]; +} + /* description */ - (void)appendAttributesToDescription:(NSMutableString *)_ms {