Monotone-Parent: 7342d9cd31675160736e0f2db8a83047d9babea9

Monotone-Revision: 4ebf80607b2a71f3b2192bd3ba8c310f15bd37f5

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-10-09T17:57:27
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-10-09 17:57:27 +00:00
parent 03382298b8
commit dc48bb9e4c
5 changed files with 190 additions and 5 deletions
+29 -1
View File
@@ -31,6 +31,7 @@
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/WOResponse.h>
#import <NGObjWeb/SoSecurityManager.h>
#import <NGObjWeb/SoClassSecurityInfo.h>
#import <SoObjects/SOGo/LDAPUserManager.h>
#import <SoObjects/SOGo/NSArray+Utilities.h>
@@ -146,7 +147,34 @@
- (WOResponse *) canAccessContentAction
{
return [self responseWith204];
#warning IMPROVEMENTS REQUIRED!
NSArray *acls;
// NSEnumerator *userAcls;
// NSString *currentAcl;
[self _setupContext];
// NSLog(@"canAccessContentAction %@, owner %@", subscriptionPointer, owner);
if ([login isEqualToString: owner] || [owner isEqualToString: @"nobody"]) {
return [self responseWith204];
}
else {
acls = [clientObject aclsForUser: login];
// userAcls = [acls objectEnumerator];
// currentAcl = [userAcls nextObject];
// while (currentAcl) {
// NSLog(@"ACL login %@, owner %@, folder %@: %@",
// login, owner, baseFolder, currentAcl);
// currentAcl = [userAcls nextObject];
// }
if (([[clientObject folderType] isEqualToString: @"Contact"] && [acls containsObject: SOGoRole_ObjectReader]) ||
([[clientObject folderType] isEqualToString: @"Appointment"] && [acls containsObject: SOGoRole_AuthorizedSubscriber])) {
return [self responseWith204];
}
}
return [self responseWithStatus: 403];
}
- (WOResponse *) _realFolderActivation: (BOOL) makeActive
+2 -2
View File
@@ -46,8 +46,8 @@ function openContactsFolder(contactsFolder, reload, idx) {
var contactsList = $("contactsList");
if (contactsList)
selection = contactsList.getSelectedRowsId();
else
window.alert("no contactsList");
// else
// window.alert("no contactsList");
}
else
selection = null;
+4 -2
View File
@@ -141,6 +141,8 @@ function openMessageWindowsForSelection(action, firstOnly) {
ApplicationBaseURL + currentMailbox
+ "/" + rows[i].substr(4)
+ "/" + action);
} else {
window.alert(labels["Please select a message."]);
}
}
@@ -232,6 +234,7 @@ function uixDeleteSelectedMessages(sender) {
url = ApplicationBaseURL + messageId + "/trash";
http = createHTTPClient();
http.open("POST", url, false /* not async */);
http.url = url;
http.send("");
if (!isHttpStatus204(http.status)) { /* request failed */
failCount++;
@@ -246,9 +249,8 @@ function uixDeleteSelectedMessages(sender) {
}
}
http = null;
/* remove from page */
/* line-through would be nicer, but hiding is OK too */
var row = $(rowIds[i]);
row.parentNode.removeChild(row);