mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-06 04:20:33 +00:00
Monotone-Parent: a084cda52b54dea2be32b37d71aefe6f27b1af33
Monotone-Revision: 8e81030e83aa6ed594c40a5f56274b5ba292f47c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-05-02T23:08:15 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -26,13 +26,42 @@
|
||||
|
||||
#import <SaxObjC/XMLNamespaces.h>
|
||||
|
||||
#import "NSObject+DAV.h"
|
||||
#import "NSString+Utilities.h"
|
||||
|
||||
#import "SOGoPermissions.h"
|
||||
#import "SOGoWebDAVAclManager.h"
|
||||
|
||||
#import "SOGoFolder.h"
|
||||
|
||||
@interface SOGoObject (SOGoDAVHelpers)
|
||||
|
||||
- (void) _fillArrayWithPrincipalsOwnedBySelf: (NSMutableArray *) hrefs;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SOGoFolder
|
||||
|
||||
+ (SOGoWebDAVAclManager *) webdavAclManager
|
||||
{
|
||||
SOGoWebDAVAclManager *webdavAclManager = nil;
|
||||
|
||||
if (!webdavAclManager)
|
||||
{
|
||||
webdavAclManager = [SOGoWebDAVAclManager new];
|
||||
[webdavAclManager registerDAVPermission: davElement (@"read", @"DAV:")
|
||||
abstract: YES
|
||||
withEquivalent: SoPerm_WebDAVAccess
|
||||
asChildOf: davElement (@"all", @"DAV:")];
|
||||
[webdavAclManager registerDAVPermission: davElement (@"read-current-user-privilege-set", @"DAV:")
|
||||
abstract: YES
|
||||
withEquivalent: nil
|
||||
asChildOf: davElement (@"read", @"DAV:")];
|
||||
}
|
||||
|
||||
return webdavAclManager;
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
@@ -75,6 +104,11 @@
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
- (NSArray *) toManyRelationshipKeys
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) isValidContentName: (NSString *) name
|
||||
{
|
||||
return ([name length] > 0);
|
||||
@@ -192,6 +226,24 @@
|
||||
return rType;
|
||||
}
|
||||
|
||||
/* web dav acl helper */
|
||||
- (void) _fillArrayWithPrincipalsOwnedBySelf: (NSMutableArray *) hrefs
|
||||
{
|
||||
NSEnumerator *children;
|
||||
NSString *currentKey;
|
||||
|
||||
[super _fillArrayWithPrincipalsOwnedBySelf: hrefs];
|
||||
children = [[self toOneRelationshipKeys] objectEnumerator];
|
||||
while ((currentKey = [children nextObject]))
|
||||
[[self lookupName: currentKey inContext: context
|
||||
acquire: NO] _fillArrayWithPrincipalsOwnedBySelf: hrefs];
|
||||
|
||||
children = [[self toManyRelationshipKeys] objectEnumerator];
|
||||
while ((currentKey = [children nextObject]))
|
||||
[[self lookupName: currentKey inContext: context
|
||||
acquire: NO] _fillArrayWithPrincipalsOwnedBySelf: hrefs];
|
||||
}
|
||||
|
||||
/* folder type */
|
||||
|
||||
- (BOOL) isEqual: (id) otherFolder
|
||||
@@ -211,6 +263,11 @@
|
||||
|
||||
/* acls */
|
||||
|
||||
- (NSString *) defaultUserID
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *) subscriptionRoles
|
||||
{
|
||||
return [NSArray arrayWithObjects: SoRole_Owner, SOGoRole_ObjectViewer,
|
||||
@@ -223,4 +280,9 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *) aclUsers
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user