2007-12-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ * UI/Common/UIxAclEditor.m ([-currentUserIsOwner]): replaced
+ method with -canModifyAcls that invokes the security manager
+ instead for the permission "SaveAcls" on the client object.
+
* SoObjects/Appointments/SOGoCalendarComponent.m
([SOGoCalendarComponent -contentAsString]): securize the returned content.
([SOGoCalendarComponent -aclsForUser:uid]): check whether the user
"Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
"Delete Objects" = ( "Owner", "ObjectEraser" );
"WebDAV Access" = ( "Owner", "ObjectViewer" );
+ "ReadAcls" = ( "Owner", "MailAdministrator" );
+ "SaveAcls" = ( "Owner", "MailAdministrator" );
};
};
SOGoSharedInboxFolder = {
extern NSString *SOGoPerm_AccessObject;
extern NSString *SOGoPerm_ReadAcls;
+extern NSString *SOGoPerm_SaveAcls;
extern NSString *SOGoPerm_FreeBusyLookup;
extern NSString *SOGoCalendarPerm_ViewWholePublicRecords;
NSString *SOGoPerm_ReadAcls = @"ReadAcls"; /* the equivalent of "read-acl" in
the WebDAV acls spec, which is
currently missing from SOPE */
+NSString *SOGoPerm_SaveAcls = @"SaveAcls";
NSString *SOGoPerm_FreeBusyLookup = @"FreeBusyLookup";
NSString *SOGoCalendarPerm_ViewWholePublicRecords = @"ViewWholePublicRecords";
#import <Foundation/NSKeyValueCoding.h>
#import <NGObjWeb/SoUser.h>
#import <NGObjWeb/WORequest.h>
+#import <NGObjWeb/SoSecurityManager.h>
#import <NGCards/iCalPerson.h>
#import <SoObjects/SOGo/LDAPUserManager.h>
#import <SoObjects/SOGo/SOGoContentObject.h>
return [self jsCloseWithRefreshMethod: nil];
}
-- (BOOL) currentUserIsOwner
+- (BOOL) canModifyAcls
{
- SOGoObject *clientObject;
- SOGoUser *user;
- NSString *currentUserLogin, *ownerLogin;
-
- clientObject = [self clientObject];
- ownerLogin = [clientObject ownerInContext: context];
- user = [context activeUser];
- currentUserLogin = [user login];
-
- return ([ownerLogin isEqualToString: currentUserLogin]
- || ([user respondsToSelector: @selector (isSuperUser)]
- && [user isSuperUser]));
+ SoSecurityManager *mgr;
+
+ mgr = [SoSecurityManager sharedSecurityManager];
+
+ return (![mgr validatePermission: SOGoPerm_SaveAcls
+ onObject: [self clientObject]
+ inContext: context]);
}
// - (id <WOActionResults>) addUserInAcls
<input id="defaultRolesBtn" type="button"
class="button" label:value="Default Roles"/>
<div class="userSelector" id="userRoles">
- <var:if condition="currentUserIsOwner">
+ <var:if condition="canModifyAcls">
<span id="userSelectorButtons">
<a href="#"
class="button"><img rsrc:src="add-contact.gif"