mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 19:35:38 +00:00
Monotone-Parent: 50485da98a8b2535a5e2511ba4e1bd8025373815
Monotone-Revision: 3539ecd8be9d6a343ed36dd75849ea9713497066 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-19T17:05:28 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
2006-12-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalMainView.m ([UIxCalMainView
|
||||
-checkRightsAction]): new action method that returns a
|
||||
comma-separated list of boolean values matching the right of the
|
||||
current user to "view" (as a permission) each foreign calendar
|
||||
stored in his preferences.
|
||||
|
||||
* SoObjects/SOGo/SOGoObject.m ([SOGoObject -setOwner:newOwner]):
|
||||
new method that sets a customOwner, which can be returned with
|
||||
ownerInContext it set.
|
||||
|
||||
@@ -128,4 +128,43 @@ static NSMutableArray *yearMenuItems = nil;
|
||||
return response;
|
||||
}
|
||||
|
||||
- (id <WOActionResults>) checkRightsAction
|
||||
{
|
||||
WOResponse *response;
|
||||
NSUserDefaults *ud;
|
||||
NSString *uids, *uid;
|
||||
NSMutableString *rights;
|
||||
NSArray *ids;
|
||||
unsigned int count, max;
|
||||
BOOL result;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
uids = [ud stringForKey: @"calendaruids"];
|
||||
|
||||
response = [context response];
|
||||
[response setStatus: 200];
|
||||
[response setHeader: @"text/plain; charset=\"utf-8\""
|
||||
forKey: @"content-type"];
|
||||
rights = [NSMutableString string];
|
||||
if ([uids length] > 0)
|
||||
{
|
||||
ids = [uids componentsSeparatedByString: @","];
|
||||
max = [ids count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
uid = [ids objectAtIndex: count];
|
||||
if ([uid hasPrefix: @"-"])
|
||||
uid = [uid substringFromIndex: 1];
|
||||
result = ([self calendarFolderForUID: uid] != nil);
|
||||
if (count == 0)
|
||||
[rights appendFormat: @"%d", result];
|
||||
else
|
||||
[rights appendFormat: @",%d", result];
|
||||
}
|
||||
}
|
||||
[response appendContentString: rights];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user