mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-25 21:35:23 +00:00
Monotone-Parent: c0acc11b80f76b2d29c66345efe502779ef82699
Monotone-Revision: 7e21b29e298fa9a1baff1c52d0d806113ce623f4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-02-16T16:54:34 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2007-02-16 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/SOGoCalendarComponent.m
|
||||
([SOGoCalendarComponent -rolesOfUser:logininContext:context]):
|
||||
returns the roles of the user on the container object if the event
|
||||
is uncreated.
|
||||
|
||||
2007-02-15 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailPartViewers/UIxMailRenderingContext.m: returns the
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#import <SOGo/AgenorUserManager.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
|
||||
#import "common.h"
|
||||
|
||||
@@ -294,27 +295,40 @@ static BOOL sendEMailNotifications = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *) roleOfUser: (NSString *) login
|
||||
- (NSArray *) rolesOfUser: (NSString *) login
|
||||
inContext: (WOContext *) context
|
||||
{
|
||||
AgenorUserManager *um;
|
||||
iCalRepeatableEntityObject *component;
|
||||
NSString *role, *email;
|
||||
NSMutableArray *sogoRoles;
|
||||
NSString *email;
|
||||
SOGoUser *user;
|
||||
|
||||
sogoRoles = [NSMutableArray new];
|
||||
[sogoRoles autorelease];
|
||||
|
||||
um = [AgenorUserManager sharedUserManager];
|
||||
email = [um getEmailForUID: login];
|
||||
|
||||
component = [self component];
|
||||
if ([component isOrganizer: email])
|
||||
role = SOGoRole_Organizer;
|
||||
else if ([component isParticipant: email])
|
||||
role = SOGoRole_Participant;
|
||||
else if ([[[self container] ownerInContext: nil] isEqualToString: login])
|
||||
role = SoRole_Owner;
|
||||
if (component)
|
||||
{
|
||||
if ([component isOrganizer: email])
|
||||
[sogoRoles addObject: SOGoRole_Organizer];
|
||||
else if ([component isParticipant: email])
|
||||
[sogoRoles addObject: SOGoRole_Participant];
|
||||
else if ([[container ownerInContext: nil] isEqualToString: login])
|
||||
[sogoRoles addObject: SoRole_Owner];
|
||||
}
|
||||
else
|
||||
role = nil;
|
||||
{
|
||||
user = [[SOGoUser alloc] initWithLogin: login roles: nil];
|
||||
[sogoRoles addObjectsFromArray: [user rolesForObject: container
|
||||
inContext: context]];
|
||||
[user release];
|
||||
}
|
||||
|
||||
return role;
|
||||
return sogoRoles;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user