+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
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
{
"ViewDAndT" = ( "Organizer", "Participant", "ComponentDAndTViewer" );
"ModifyComponent" = ( "Owner", "Organizer" );
"RespondToComponent" = ( "Participant" );
- "Access Object" = ( "Owner", "Organizer", "Participant", "ComponentModifier", "ComponentResponder", "ComponentViewer", "ComponentDAndTViewer" );
};
};
SOGoAppointmentObject = {
#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
{
[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;
"Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
"Delete Objects" = ( "Owner", "ObjectEraser" );
"WebDAV Access" = ( "Owner", "AuthorizedSubscriber" );
- "ReadAcls" = ( "Owner", "AuthorizedSubscriber" );
- "SaveAcls" = ( "Owner" );
};
};
SOGoMailAccount = {
"Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
"Delete Objects" = ( "Owner", "ObjectEraser" );
"WebDAV Access" = ( "Owner", "AuthorizedSubscriber" );
- "ReadAcls" = ( "Owner", "AuthorizedSubscriber" );
- "SaveAcls" = ( "Owner" );
};
};
SOGoSharedMailAccount = {
"Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
"Delete Objects" = ( "Owner", "ObjectEraser" );
"WebDAV Access" = ( "Owner", "ObjectViewer" );
- "ReadAcls" = ( "Owner", "ObjectViewer" );
- "SaveAcls" = ( "Owner", "MailAdministrator" );
};
};
SOGoSharedInboxFolder = {
#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;
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;
}
/* acls */
+- (NSArray *) subscriptionRoles;
+
- (NSArray *) aclUsers;
- (NSArray *) aclsForUser: (NSString *) uid;
- (void) setRoles: (NSArray *) roles
/* acls */
+/* roles required to obtain the "authorized subscriber" role */
+- (NSArray *) subscriptionRoles
+{
+ return [container subscriptionRoles];
+}
+
- (NSArray *) aclUsers
{
[self subclassResponsibility: _cmd];
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;
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" );
};
};
};
-
SOGoFolder = {
superclass = "SOGoObject";
protectedBy = "Access Object";