Monotone-Parent: 4ae01eea0221889e088ac21232d629d3b265be05

Monotone-Revision: 07066101c28f825ad99e746c40e1e3eb5c46ffd5

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-12-06T22:54:01
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-12-06 22:54:01 +00:00
parent e1c159094d
commit 790e92d2ea
6 changed files with 90 additions and 26 deletions

View File

@@ -1025,6 +1025,7 @@
SoSecurityManager *sm;
NSString *toolbarFilename, *adminToolbar;
iCalPersonPartStat participationStatus;
SOGoUser *currentUser;
if ([clientObject isKindOfClass: [SOGoAppointmentObject class]])
adminToolbar = @"SOGoAppointmentObject.toolbar";
@@ -1034,28 +1035,37 @@
sm = [SoSecurityManager sharedSecurityManager];
if ([[component attendees] count])
{
if ([component userIsOrganizer: ownerUser]
&& ![sm validatePermission: SOGoCalendarPerm_ModifyComponent
onObject: clientObject
inContext: context])
toolbarFilename = adminToolbar;
else if ([component userIsParticipant: ownerUser]
&& ![sm validatePermission: SOGoCalendarPerm_RespondToComponent
onObject: clientObject
inContext: context])
{
participationStatus
= [[component findParticipant: ownerUser] participationStatus];
/* Lightning does not manage participation status within tasks */
if (participationStatus == iCalPersonPartStatAccepted)
toolbarFilename = @"SOGoAppointmentObjectDecline.toolbar";
else if (participationStatus == iCalPersonPartStatDeclined)
toolbarFilename = @"SOGoAppointmentObjectAccept.toolbar";
else
toolbarFilename = @"SOGoAppointmentObjectAcceptOrDecline.toolbar";
}
else
currentUser = [context activeUser];
if ([component userIsOrganizer: currentUser])
toolbarFilename = @"SOGoComponentClose.toolbar";
else
{
if ([component userIsOrganizer: ownerUser]
&& ![sm validatePermission: SOGoCalendarPerm_ModifyComponent
onObject: clientObject
inContext: context])
toolbarFilename = adminToolbar;
else if ([component userIsParticipant: ownerUser]
&& !([sm validatePermission: SOGoCalendarPerm_RespondToComponent
onObject: clientObject
inContext: context]
&& [sm validatePermission: SOGoCalendarPerm_ModifyComponent
onObject: clientObject
inContext: context]))
{
participationStatus
= [[component findParticipant: ownerUser] participationStatus];
/* Lightning does not manage participation status within tasks */
if (participationStatus == iCalPersonPartStatAccepted)
toolbarFilename = @"SOGoAppointmentObjectDecline.toolbar";
else if (participationStatus == iCalPersonPartStatDeclined)
toolbarFilename = @"SOGoAppointmentObjectAccept.toolbar";
else
toolbarFilename = @"SOGoAppointmentObjectAcceptOrDecline.toolbar";
}
else
toolbarFilename = @"SOGoComponentClose.toolbar";
}
}
else
{