From e980271d556fda8320c3c17962a38cef121003aa Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 17 May 2007 18:28:52 +0000 Subject: [PATCH 01/10] Monotone-Parent: 6e1fa9dae975f5a8d923b0d451cd9551b0f14f4c Monotone-Revision: 8e2c6ddaf3c71a1dafcf70d50888b680e8a2d0db Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-17T18:28:52 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/UIxAclEditor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/UI/WebServerResources/UIxAclEditor.js b/UI/WebServerResources/UIxAclEditor.js index d7a3c6d09..779d95753 100644 --- a/UI/WebServerResources/UIxAclEditor.js +++ b/UI/WebServerResources/UIxAclEditor.js @@ -22,6 +22,7 @@ function nodeForUser(userName, userId) { node.setAttribute("id", userId); node.setAttribute("class", ""); node.addEventListener("mousedown", listRowMouseDownHandler, true); + node.addEventListener("dblclick", onOpenUserRights, false); node.addEventListener("click", onRowClick, true); var image = document.createElement("img"); From e201d071d62ef753dc46fb26b13332949354139f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 17 May 2007 23:02:09 +0000 Subject: [PATCH 02/10] Monotone-Parent: 8e2c6ddaf3c71a1dafcf70d50888b680e8a2d0db Monotone-Revision: 108c385b2d4d62eead27a0717dfe26849f3e4968 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-17T23:02:09 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ SoObjects/SOGo/SOGoPermissions.h | 1 + SoObjects/SOGo/SOGoPermissions.m | 1 + 3 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 057c22cfa..1b7288f25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-17 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoPermissions.m: added a new void role + "SOGoRole_None". + 2007-05-16 Wolfgang Sourdeau * SoObjects/SOGo/NSString+Utilities.m ([NSString diff --git a/SoObjects/SOGo/SOGoPermissions.h b/SoObjects/SOGo/SOGoPermissions.h index e6825554d..67ee64bee 100644 --- a/SoObjects/SOGo/SOGoPermissions.h +++ b/SoObjects/SOGo/SOGoPermissions.h @@ -32,6 +32,7 @@ extern NSString *SOGoRole_ObjectEraser; extern NSString *SOGoRole_ObjectViewer; extern NSString *SOGoRole_ObjectEditor; extern NSString *SOGoRole_AuthorizedSubscriber; +extern NSString *SOGoRole_None; extern NSString *SOGoRole_FreeBusy; extern NSString *SOGoRole_FreeBusyLookup; diff --git a/SoObjects/SOGo/SOGoPermissions.m b/SoObjects/SOGo/SOGoPermissions.m index a071f019f..e750ef31b 100644 --- a/SoObjects/SOGo/SOGoPermissions.m +++ b/SoObjects/SOGo/SOGoPermissions.m @@ -28,6 +28,7 @@ NSString *SOGoRole_ObjectEraser = @"ObjectEraser"; NSString *SOGoRole_ObjectViewer = @"ObjectViewer"; NSString *SOGoRole_ObjectEditor = @"ObjectEditor"; NSString *SOGoRole_AuthorizedSubscriber = @"AuthorizedSubscriber"; +NSString *SOGoRole_None = @"None"; NSString *SOGoRole_FreeBusy = @"FreeBusy"; /* for the "freebusy" special user */ From 51cf0206d7cdd671482ff033d52f09636ce0904f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 17 May 2007 23:05:47 +0000 Subject: [PATCH 03/10] Monotone-Parent: 108c385b2d4d62eead27a0717dfe26849f3e4968 Monotone-Revision: 9de11b8398fba6c77d839866803040e019e78660 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-17T23:05:47 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 +++ UI/Common/UIxUserRightsEditor.m | 26 ++++++++++++------- .../UIxContactsUserRightsEditor.wox | 9 +++++-- .../SchedulerUI/UIxCalUserRightsEditor.wox | 9 +++++-- 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b7288f25..d85bf9323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-05-17 Wolfgang Sourdeau + * UI/Common/UIxUserRightsEditor.m ([UIxUserRightsEditor + -_initRights]): don't take the "None" role into account when + initializing the list of current roles. + * SoObjects/SOGo/SOGoPermissions.m: added a new void role "SOGoRole_None". diff --git a/UI/Common/UIxUserRightsEditor.m b/UI/Common/UIxUserRightsEditor.m index 35b697612..8ec44dd46 100644 --- a/UI/Common/UIxUserRightsEditor.m +++ b/UI/Common/UIxUserRightsEditor.m @@ -24,6 +24,7 @@ #import #import #import +#import #import "UIxUserRightsEditor.h" @@ -52,10 +53,15 @@ return uid; } +- (BOOL) userIsDefaultUser +{ + return [uid isEqualToString: SOGoDefaultUserID]; +} + - (NSString *) userDisplayName { LDAPUserManager *um; - + um = [LDAPUserManager sharedUserManager]; return [NSString stringWithFormat: @"%@ <%@>", @@ -66,9 +72,10 @@ - (BOOL) _initRights { BOOL response; - NSString *newUID, *email; + NSString *newUID; LDAPUserManager *um; SOGoObject *clientObject; + unsigned int count; response = NO; @@ -76,15 +83,17 @@ if ([newUID length] > 0) { um = [LDAPUserManager sharedUserManager]; - email = [um getEmailForUID: newUID]; - if ([email length] > 0) + if ([newUID isEqualToString: SOGoDefaultUserID] + || [[um getEmailForUID: newUID] length] > 0) { ASSIGN (uid, newUID); clientObject = [self clientObject]; [userRights addObjectsFromArray: [clientObject aclsForUser: uid]]; - if (![userRights count]) - [userRights addObjectsFromArray: [clientObject defaultAclRoles]]; - + count = [userRights count]; + if (!count || (count == 1 && [[userRights objectAtIndex: 0] + isEqualToString: SOGoRole_None])) + [userRights setArray: [clientObject defaultAclRoles]]; + response = YES; } } @@ -118,8 +127,7 @@ else { [self updateRights]; - [[self clientObject] setRoles: userRights - forUser: uid]; + [[self clientObject] setRoles: userRights forUser: uid]; response = [self jsCloseWithRefreshMethod: nil]; } diff --git a/UI/Templates/ContactsUI/UIxContactsUserRightsEditor.wox b/UI/Templates/ContactsUI/UIxContactsUserRightsEditor.wox index e14ea785f..39b25787d 100644 --- a/UI/Templates/ContactsUI/UIxContactsUserRightsEditor.wox +++ b/UI/Templates/ContactsUI/UIxContactsUserRightsEditor.wox @@ -13,8 +13,13 @@
- + + + +