]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1046 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 12 Apr 2007 00:37:29 +0000 (00:37 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 12 Apr 2007 00:37:29 +0000 (00:37 +0000)
SoObjects/Contacts/SOGoContactFolders.m
SoObjects/Contacts/product.plist
SoObjects/Mailer/SOGoMailAccounts.m
SoObjects/SOGo/SOGoUser.m
UI/MainUI/product.plist

index 6e61cc6753a73da770fdc0e130d20d942888dd70..c2f0a71728c652e695d9ddb5291a382185201fe5 100644 (file)
   return [contactFolders allValues];
 }
 
-- (NSString *) roleOfUser: (NSString *) uid
-{
-  NSArray *roles, *traversalPath;
-  NSString *objectName, *role;
-
-  role = nil;
-  traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
-  if ([traversalPath count] > 2)
-    {
-      objectName = [traversalPath objectAtIndex: 2];
-      roles = [[context activeUser]
-               rolesForObject: [self lookupName: objectName
-                                     inContext: context
-                                     acquire: NO]
-               inContext: context];
-      if ([roles containsObject: SOGoRole_Assistant]
-         || [roles containsObject: SOGoRole_Delegate])
-       role = SOGoRole_Assistant;
-    }
-
-  return role;
-}
+// - (NSString *) roleOfUser: (NSString *) uid
+// {
+//   NSArray *roles, *traversalPath;
+//   NSString *objectName, *role;
+
+//   role = nil;
+//   traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
+//   if ([traversalPath count] > 2)
+//     {
+//       objectName = [traversalPath objectAtIndex: 2];
+//       roles = [[context activeUser]
+//             rolesForObject: [self lookupName: objectName
+//                                   inContext: context
+//                                   acquire: NO]
+//             inContext: context];
+//       if ([roles containsObject: SOGoRole_Assistant]
+//       || [roles containsObject: SOGoRole_Delegate])
+//     role = SOGoRole_Assistant;
+//     }
+
+//   return role;
+// }
 
 - (BOOL) davIsCollection
 {
index 6766efe025805f1585e741280bc5e955e940412b..349d27eca899976c31b1293abf34a738c83ef4e4 100644 (file)
@@ -9,14 +9,11 @@
   
   classes = {
     SOGoContactFolders = {
-      superclass    = "SOGoObject";
+      superclass  = "SOGoFolder";
+      protectedBy = "<public>";
+      defaultAccess = "allow";
       defaultRoles = {
-        "Add Documents, Images, and Files" = ( "Owner", "Delegate" );
-        "View" = ( "Owner", "Delegate", "Assistant" );
-        "WebDAV Access" = ( "Owner", "Delegate", "Assistant" );
-        "Access Contents Information" = ( "Owner", "Assistant", "Delegate" );
-        "ReadAcls" = ( "Owner", "Delegate", "Assistant" );
-        "SaveAcls" = ( "Owner" );
+        "View" = ( "Owner" );
       };
     };
 
index ed041aa38c340904bd6bd8664397d08fabe77d68..d33c58c9702c352f98ae68e2c7f1fd5de9e5930a 100644 (file)
@@ -37,17 +37,16 @@ static NSString *AgenorShareLoginMarker  = @".-.";
 
 /* listing the available mailboxes */
 
-- (BOOL)isInHomeFolderBranchOfLoggedInAccount:(id)_ctx {
-  id user;
-
-  user = [_ctx activeUser];
-  return [[[self container] nameInContainer] isEqualToString:[user login]];
+- (BOOL) isInHomeFolderBranchOfLoggedInAccount: (NSString *) userLogin
+{
+  return [[[self container] nameInContainer] isEqualToString: userLogin];
 }
 
 - (NSArray *)toManyRelationshipKeys {
-  id        user;
+  SOGoUser *user;
   id        account;
   NSArray   *shares;
+  NSString *userLogin;
   
   /*
     Note: this is not strictly correct. The accounts being retrieved should be
@@ -60,15 +59,16 @@ static NSString *AgenorShareLoginMarker  = @".-.";
          => TODO
   */
   user = [context activeUser];
+  userLogin = [user login];
   
   /* for now: return nothing if the home-folder does not belong to the login */
-  if (![self isInHomeFolderBranchOfLoggedInAccount: context]) {
+  if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
     [self warnWithFormat:@"User %@ tried to access mail hierarchy of %@",
          [user login], [[self container] nameInContainer]];
     return nil;
   }
   
-  account = [user valueForKey:@"primaryIMAP4AccountString"];
+  account = [user primaryIMAP4AccountString];
   if ([account isNotNull]) account = [NSArray arrayWithObject:account];
   
   if ([self isInternetRequest]) /* only show primary mailbox in Internet */
@@ -141,16 +141,20 @@ static NSString *AgenorShareLoginMarker  = @".-.";
   return [ct autorelease];
 }
 
-- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
+- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag
+{
   id obj;
+  NSString *userLogin;
+
+  userLogin = [[context activeUser] login];
   
   /* first check attributes directly bound to the application */
   if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
     return obj;
   
-  if (![self isInHomeFolderBranchOfLoggedInAccount:_ctx]) {
+  if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
     [self warnWithFormat:@"User %@ tried to access mail hierarchy of %@",
-         [[_ctx activeUser] login], [[self container] nameInContainer]];
+         userLogin, [[self container] nameInContainer]];
     
     return [NSException exceptionWithHTTPStatus:403 /* Forbidden */
                        reason:@"Tried to access the mail of another user"];
index e10b9931c895c03adf97eef5889613a32b44bc9d..d2e9829e90726a3fe9c66eae68d7aa8164de4226 100644 (file)
@@ -267,13 +267,13 @@ static NSTimeZone *serverTimeZone = nil;
       if (sogoRoles)
         [rolesForObject addObjectsFromArray: sogoRoles];
     }
-  if ([object respondsToSelector: @selector (rolesOfUser:inContext:)])
+  if ([object respondsToSelector: @selector (rolesOfUser:)])
     {
       sogoRoles = [object rolesOfUser: login];
       if (sogoRoles)
         [rolesForObject addObjectsFromArray: sogoRoles];
     }
-  if ([object respondsToSelector: @selector (roleOfUser:inContext:)])
+  if ([object respondsToSelector: @selector (roleOfUser:)])
     {
       role = [object roleOfUser: login];
       if (role)
index 8cca37cd03c8d60969c7333b3fa858efaeb6f251..a189d3c305cb8075d460073e71efeee0d20dc346 100644 (file)
@@ -19,6 +19,9 @@
       superclass  = "SOGoFolder";
       protectedBy = "<public>";
       defaultAccess = "allow";
+      defaultRoles = {
+        "View" = ( "Owner" );
+      };
       /* protectedBy = "HomePage Access"; */
     };
     SOGoFolder = {
     SOGoRootPage = {
     };
     SOGoUserFolder = {
+      methods = {
+        view = {
+          protectedBy = "View";
+          pageName    = "SOGoUserHomePage";
+        };
+      };
     };
     SOGoGroupsFolder = {
       methods = {