]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1282 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 29 Nov 2007 16:15:37 +0000 (16:15 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 29 Nov 2007 16:15:37 +0000 (16:15 +0000)
12 files changed:
ChangeLog
SoObjects/Appointments/SOGoAppointmentFolder.m
SoObjects/Appointments/product.plist
SoObjects/Contacts/SOGoContactLDAPFolder.m
SoObjects/Mailer/SOGoMailFolder.m
SoObjects/Mailer/product.plist
SoObjects/SOGo/SOGoFolder.m
SoObjects/SOGo/SOGoGCSFolder.m
SoObjects/SOGo/SOGoObject.h
SoObjects/SOGo/SOGoObject.m
SoObjects/SOGo/SOGoUser.m
UI/MainUI/product.plist

index ac7004ae9bc5137663dcb2717fa05ba543dc75f1..716be00519c1253ac36ce81b03a0d26317b8d464 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-29  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/SOGo/SOGoObject.m ([SOGoObject -subscriptionRoles]):
+       new method that returns the roles that qualifies for adding the
+       special "authorized subscribed" sogo role.
+
 2007-11-27  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject
index 48c9478c7c4b15079524db80747aa3356ae097a6..f4753e7c362e5941bfc199e6b45a887e43068b93 100644 (file)
@@ -775,6 +775,24 @@ static NSNumber   *sharedYes = nil;
   return privacySqlString;
 }
 
+- (NSArray *) subscriptionRoles
+{
+  return [NSArray arrayWithObjects:
+                   SOGoRole_ObjectCreator, SOGoRole_ObjectEraser,
+                 SOGoCalendarRole_PublicResponder,
+                 SOGoCalendarRole_PublicModifier,
+                 SOGoCalendarRole_PublicViewer,
+                 SOGoCalendarRole_PublicDAndTViewer,
+                 SOGoCalendarRole_PrivateResponder,
+                 SOGoCalendarRole_PrivateModifier,
+                 SOGoCalendarRole_PrivateViewer,
+                 SOGoCalendarRole_PrivateDAndTViewer,
+                 SOGoCalendarRole_ConfidentialResponder,
+                 SOGoCalendarRole_ConfidentialModifier,
+                 SOGoCalendarRole_ConfidentialViewer,
+                 SOGoCalendarRole_ConfidentialDAndTViewer, nil];
+}
+
 - (NSString *) roleForComponentsWithAccessClass: (iCalAccessClass) accessClass
                                        forUser: (NSString *) uid
 {
index 6b2ecb324f0084825e22c9970366adbb6147967e..538ad319e0e41ae20f7bcbb5ea78ed6fa83ab817 100644 (file)
@@ -39,7 +39,6 @@
        "ViewDAndT" = ( "Organizer", "Participant", "ComponentDAndTViewer" );
        "ModifyComponent" = ( "Owner", "Organizer" );
        "RespondToComponent" = ( "Participant" );
-       "Access Object" = ( "Owner", "Organizer", "Participant", "ComponentModifier", "ComponentResponder", "ComponentViewer", "ComponentDAndTViewer" );
       };
     };
     SOGoAppointmentObject = {
index b35f0d0d78502386b614253dc8c8ed9b715ac47e..a23f09a536c6ef3b2cac896c6d03680dd477d2c8 100644 (file)
 
 #import <NGObjWeb/NSException+HTTP.h>
 #import <NGObjWeb/WOApplication.h>
-#import <NGObjWeb/WOContext.h>
 #import <NGObjWeb/WOContext+SoObjects.h>
+#import <NGObjWeb/WORequest.h>
 #import <NGObjWeb/WOResponse.h>
 #import <NGObjWeb/SoObject.h>
+#import <NGObjWeb/SoSelectorInvocation.h>
 #import <NGObjWeb/SoUser.h>
+#import <NGExtensions/NSString+misc.h>
 #import <EOControl/EOSortOrdering.h>
 #import <SaxObjC/XMLNamespaces.h>
 
+#import <SoObjects/SOGo/SOGoPermissions.h>
 #import <SoObjects/SOGo/LDAPSource.h>
 #import <SoObjects/SOGo/NSString+Utilities.h>
 #import "SOGoContactLDIFEntry.h"
 #import "SOGoContactLDAPFolder.h"
-#import <NGExtensions/NSString+misc.h>
-#import <NGObjWeb/WORequest.h>
-#import <NGObjWeb/SoSelectorInvocation.h>
 
 @class WOContext;
 
   return @"nobody";
 }
 
+- (NSArray *) subscriptionRoles
+{
+  return [NSArray arrayWithObject: SoRole_Authenticated];
+}
+
 /* TODO: this might change one day when we support LDAP acls */
 - (NSArray *) aclsForUser: (NSString *) uid
 {
index a0cff9ecfc6e7ac34e2ca1d3b89668d79a6ddf9a..1486c00c09d91fa58e4bb414a5090ff34dac81bc 100644 (file)
@@ -544,6 +544,16 @@ static NSString *defaultUserID =  @"anyone";
   [mailboxACL retain];
 }
 
+- (NSArray *) subscriptionRoles
+{
+  return [NSArray arrayWithObjects: SOGoRole_ObjectViewer,
+                 SOGoMailRole_SeenKeeper, SOGoMailRole_Writer,
+                 SOGoRole_ObjectCreator, SOGoMailRole_Poster,
+                 SOGoRole_FolderCreator, SOGoRole_FolderEraser,
+                 SOGoRole_ObjectEraser, SOGoMailRole_Expunger,
+                 SOGoMailRole_Administrator, nil];
+}
+
 - (NSArray *) aclUsers
 {
   NSArray *users;
index 238a6229457eabf6973f9aa8c73f025386e6702c..88954481c42a4a093f2210063c82444520fa7757 100644 (file)
@@ -19,8 +19,6 @@
         "Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
         "Delete Objects" = ( "Owner", "ObjectEraser" );
         "WebDAV Access" = ( "Owner", "AuthorizedSubscriber" );
-        "ReadAcls" = ( "Owner", "AuthorizedSubscriber" );
-        "SaveAcls" = ( "Owner" );
       };
     };
     SOGoMailAccount = {
@@ -31,8 +29,6 @@
         "Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
         "Delete Objects" = ( "Owner", "ObjectEraser" );
         "WebDAV Access" = ( "Owner", "AuthorizedSubscriber" );
-        "ReadAcls" = ( "Owner", "AuthorizedSubscriber" );
-        "SaveAcls" = ( "Owner" );
       };
     };
     SOGoSharedMailAccount = {
@@ -46,8 +42,6 @@
         "Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
         "Delete Objects" = ( "Owner", "ObjectEraser" );
         "WebDAV Access" = ( "Owner", "ObjectViewer" );
-        "ReadAcls" = ( "Owner", "ObjectViewer" );
-        "SaveAcls" = ( "Owner", "MailAdministrator" );
       };
     };
     SOGoSharedInboxFolder = {
index 0f481510364e3eba4a7ac3d08f82b6442d598f8c..1460deb104b214d8e76cd3d6ac1e1de6ade7c239 100644 (file)
@@ -30,6 +30,7 @@
 
 #import "NSString+Utilities.h"
 
+#import "SOGoPermissions.h"
 #import "SOGoFolder.h"
 
 @implementation SOGoFolder
 
 /* acls */
 
+- (NSArray *) subscriptionRoles
+{
+  return [NSArray arrayWithObjects: SoRole_Owner, SOGoRole_ObjectViewer,
+                 SOGoRole_ObjectEditor, SOGoRole_ObjectCreator,
+ SOGoRole_ObjectEraser, nil];
+}
+
 - (NSArray *) aclsForUser: (NSString *) uid
 {
   return nil;
index 8eb59067e35fb4cf70314125707afcc5759ce487..1698d06d6d51097396b18a2421dc8505f2b5c6bf 100644 (file)
@@ -452,10 +452,7 @@ static NSString *defaultUserID = @"<default>";
 
   acls = [NSMutableArray array];
   if ([records count] > 0)
-    {
-      [acls addObject: SOGoRole_AuthorizedSubscriber];
-      [acls addObjectsFromArray: [records valueForKey: @"c_role"]];
-    }
+    [acls addObjectsFromArray: [records valueForKey: @"c_role"]];
 
   return acls;
 }
index 5404508a03d001cec8d7c7fa906ad37841bf35d9..a6ff53d27ead3e78dfeeb2a045253a0aca19506f 100644 (file)
 
 /* acls */
 
+- (NSArray *) subscriptionRoles;
+
 - (NSArray *) aclUsers;
 - (NSArray *) aclsForUser: (NSString *) uid;
 - (void) setRoles: (NSArray *) roles
index 3b8f9ca27497b41a04bb12acba84d533b64a70e9..ff29a3c463f236cc076969c4dbe2677372285126 100644 (file)
@@ -830,6 +830,12 @@ static BOOL kontactGroupDAV = YES;
 
 /* acls */
 
+/* roles required to obtain the "authorized subscriber" role */
+- (NSArray *) subscriptionRoles
+{
+  return [container subscriptionRoles];
+}
+
 - (NSArray *) aclUsers
 {
   [self subclassResponsibility: _cmd];
index bdf37fa0edc39daaaec3e1143a675d77f4cafc51..9c7bd9d3d99a73084b8522f17d799edc7f92aa3e 100644 (file)
@@ -604,8 +604,11 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
   if ([object isKindOfClass: [SOGoObject class]])
     {
       sogoRoles = [(SOGoObject *) object aclsForUser: login];
-      if (sogoRoles)
+      if ([sogoRoles count])
         [rolesForObject addObjectsFromArray: sogoRoles];
+      sogoRoles = [(SOGoObject *) object subscriptionRoles];
+      if ([sogoRoles firstObjectCommonWithArray: rolesForObject])
+       [rolesForObject addObject: SOGoRole_AuthorizedSubscriber];
     }
 
   return rolesForObject;
index 05ffd14643394918967f8544260731335b84d775..cac3981ee00e6449dabb16daab38bdf0976ebe1e 100644 (file)
@@ -21,7 +21,7 @@
       defaultRoles = {
        "View" = ( "Owner", "ObjectViewer" );
        "Change Images And Files"  = ( "Owner", "ObjectEditor" );
-       "Access Object" = ( "Owner", "ObjectViewer", "ObjectEditor", "ObjectCreator", "ObjectEraser" );
+       "Access Object" = ( "Owner", "AuthorizedSubscriber" );
        "Access Contents Information" = ( "Owner", "ObjectViewer" );
         "Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
        "Add Folders" = ( "Owner", "FolderCreator" );
@@ -51,7 +51,6 @@
        };
       };
     };
-
     SOGoFolder = {
       superclass = "SOGoObject";
       protectedBy = "Access Object";