mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-17 17:28:12 +00:00
Monotone-Parent: 7d01af187554df2b24caa2526dd92eea0e8454ee
Monotone-Revision: 140cf39d8e4843502d824435239a59f459c181d7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-04-17T14:32:47 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
4a265cdcbd
commit
fa452e68e7
3 files changed
+78
-42
No files matched your search
@@ -1,5 +1,12 @@
|
|||||||
2007-04-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2007-04-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject -acls]):
|
||||||
|
new method to comply with the new acl "protocol" in SOGoObject.
|
||||||
|
Uses SOGoFolder's new facilities for ACLS.
|
||||||
|
([SOGoContentObject -aclsForUser:uid]): idem.
|
||||||
|
([SOGoContentObject -setRoles:rolesforUser:uid]): idem.
|
||||||
|
([SOGoContentObject -removeAclsForUsers:users]): idem.
|
||||||
|
|
||||||
* SoObjects/SOGo/SOGoFolder.m ([SOGoFolder
|
* SoObjects/SOGo/SOGoFolder.m ([SOGoFolder
|
||||||
-aclsForObjectAtPath:objectPathArray]): new method generic to GCS
|
-aclsForObjectAtPath:objectPathArray]): new method generic to GCS
|
||||||
based folders. This method is derived from the code that was in
|
based folders. This method is derived from the code that was in
|
||||||
|
|||||||
@@ -25,7 +25,9 @@
|
|||||||
|
|
||||||
#import <SOGo/SOGoObject.h>
|
#import <SOGo/SOGoObject.h>
|
||||||
|
|
||||||
@class NSString, NSException;
|
@class NSArray;
|
||||||
|
@class NSException;
|
||||||
|
@class NSString;
|
||||||
|
|
||||||
@interface SOGoContentObject : SOGoObject
|
@interface SOGoContentObject : SOGoObject
|
||||||
{
|
{
|
||||||
@@ -35,29 +37,29 @@
|
|||||||
|
|
||||||
/* accessors */
|
/* accessors */
|
||||||
|
|
||||||
- (void)setOCSPath:(NSString *)_path;
|
- (void) setOCSPath: (NSString *) _path;
|
||||||
- (NSString *)ocsPath;
|
- (NSString *) ocsPath;
|
||||||
|
|
||||||
/* folder */
|
/* folder */
|
||||||
|
|
||||||
- (NSString *)ocsPathOfContainer;
|
- (NSString *) ocsPathOfContainer;
|
||||||
- (GCSFolder *)ocsFolder;
|
- (GCSFolder *) ocsFolder;
|
||||||
|
|
||||||
/* content */
|
/* content */
|
||||||
|
|
||||||
- (NSString *)contentAsString;
|
- (NSString *) contentAsString;
|
||||||
- (NSException *)saveContentString:(NSString *)_str
|
- (NSException *) saveContentString: (NSString *) _str
|
||||||
baseVersion:(unsigned int)_baseVersion;
|
baseVersion: (unsigned int) _baseVersion;
|
||||||
- (NSException *)saveContentString:(NSString *)_str;
|
- (NSException *) saveContentString: (NSString *)_str;
|
||||||
- (NSException *)delete;
|
- (NSException *) delete;
|
||||||
|
|
||||||
/* etag support */
|
/* etag support */
|
||||||
|
|
||||||
- (id)davEntityTag;
|
- (id) davEntityTag;
|
||||||
|
|
||||||
/* message type */
|
/* message type */
|
||||||
|
|
||||||
- (NSString *)outlookMessageClass;
|
- (NSString *) outlookMessageClass;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -36,15 +36,15 @@
|
|||||||
// TODO: check superclass version
|
// TODO: check superclass version
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[self->content release];
|
[content release];
|
||||||
[self->ocsPath release];
|
[ocsPath release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* notifications */
|
/* notifications */
|
||||||
|
|
||||||
- (void)sleep {
|
- (void)sleep {
|
||||||
[self->content release]; self->content = nil;
|
[content release]; content = nil;
|
||||||
[super sleep];
|
[super sleep];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,26 +55,26 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)setOCSPath:(NSString *)_path {
|
- (void)setOCSPath:(NSString *)_path {
|
||||||
if ([self->ocsPath isEqualToString:_path])
|
if ([ocsPath isEqualToString:_path])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (self->ocsPath)
|
if (ocsPath)
|
||||||
[self warnWithFormat:@"GCS path is already set! '%@'", _path];
|
[self warnWithFormat:@"GCS path is already set! '%@'", _path];
|
||||||
|
|
||||||
ASSIGNCOPY(self->ocsPath, _path);
|
ASSIGNCOPY(ocsPath, _path);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)ocsPath {
|
- (NSString *)ocsPath {
|
||||||
if (self->ocsPath == nil) {
|
if (ocsPath == nil) {
|
||||||
NSString *p;
|
NSString *p;
|
||||||
|
|
||||||
if ((p = [self ocsPathOfContainer]) != nil) {
|
if ((p = [self ocsPathOfContainer]) != nil) {
|
||||||
if (![p hasSuffix:@"/"]) p = [p stringByAppendingString:@"/"];
|
if (![p hasSuffix:@"/"]) p = [p stringByAppendingString:@"/"];
|
||||||
p = [p stringByAppendingString:[self nameInContainer]];
|
p = [p stringByAppendingString:[self nameInContainer]];
|
||||||
self->ocsPath = [p copy];
|
ocsPath = [p copy];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return self->ocsPath;
|
return ocsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)ocsPathOfContainer {
|
- (NSString *)ocsPathOfContainer {
|
||||||
@@ -84,32 +84,26 @@
|
|||||||
return [[self container] ocsPath];
|
return [[self container] ocsPath];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (GCSFolder *)ocsFolder {
|
- (GCSFolder *) ocsFolder
|
||||||
if (![[self container] respondsToSelector:@selector(ocsFolder)])
|
{
|
||||||
return nil;
|
return [container ocsFolder];
|
||||||
|
|
||||||
return [[self container] ocsFolder];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* content */
|
/* content */
|
||||||
|
|
||||||
- (NSString *)contentAsString {
|
- (NSString *) contentAsString
|
||||||
GCSFolder *folder;
|
{
|
||||||
|
if (!content)
|
||||||
|
{
|
||||||
|
content = [[self ocsFolder] fetchContentWithName: nameInContainer];
|
||||||
|
[content retain];
|
||||||
|
}
|
||||||
|
|
||||||
if (self->content != nil)
|
return content;
|
||||||
return self->content;
|
|
||||||
|
|
||||||
if ((folder = [self ocsFolder]) == nil) {
|
|
||||||
[self errorWithFormat:@"Did not find folder of content object."];
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
self->content = [[folder fetchContentWithName:[self nameInContainer]] copy];
|
|
||||||
return self->content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSException *)saveContentString:(NSString *)_str
|
- (NSException *) saveContentString: (NSString *) _str
|
||||||
baseVersion:(unsigned int)_baseVersion
|
baseVersion: (unsigned int) _baseVersion
|
||||||
{
|
{
|
||||||
/* Note: "iCal multifolder saves" are implemented in the apt subclass! */
|
/* Note: "iCal multifolder saves" are implemented in the apt subclass! */
|
||||||
GCSFolder *folder;
|
GCSFolder *folder;
|
||||||
@@ -184,8 +178,8 @@
|
|||||||
@"reassigned a new location for special new-location: %@", tmp];
|
@"reassigned a new location for special new-location: %@", tmp];
|
||||||
|
|
||||||
/* kinda dangerous */
|
/* kinda dangerous */
|
||||||
ASSIGNCOPY(self->nameInContainer, tmp);
|
ASSIGNCOPY(nameInContainer, tmp);
|
||||||
ASSIGN(self->ocsPath, nil);
|
ASSIGN(ocsPath, nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* determine base version from etag in if-match header */
|
/* determine base version from etag in if-match header */
|
||||||
@@ -311,6 +305,39 @@
|
|||||||
return [self isFolderish];
|
return [self isFolderish];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* acls */
|
||||||
|
|
||||||
|
- (NSString *) defaultAclRoles
|
||||||
|
{
|
||||||
|
#warning this should be changed to something useful
|
||||||
|
return @"tourist";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *) acls
|
||||||
|
{
|
||||||
|
return [container aclsForObjectAtPath: [self pathArrayToSoObject]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *) aclsForUser: (NSString *) uid
|
||||||
|
{
|
||||||
|
return [container aclsForUser: uid
|
||||||
|
forObjectAtPath: [self pathArrayToSoObject]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setRoles: (NSString *) roles
|
||||||
|
forUser: (NSString *) uid
|
||||||
|
{
|
||||||
|
return [container setRoles: roles
|
||||||
|
forUser: uid
|
||||||
|
forObjectAtPath: [self pathArrayToSoObject]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) removeAclsForUsers: (NSArray *) users
|
||||||
|
{
|
||||||
|
return [container removeAclsForUsers: users
|
||||||
|
forObjectAtPath: [self pathArrayToSoObject]];
|
||||||
|
}
|
||||||
|
|
||||||
/* message type */
|
/* message type */
|
||||||
|
|
||||||
- (NSString *)outlookMessageClass {
|
- (NSString *)outlookMessageClass {
|
||||||
|
|||||||
Reference in new issue
Block a user