Monotone-Parent: 975188efc102040c8f1f704d2084d9798480bcb8
Monotone-Revision: 90d12047f041f8515efbf14e53d72f0e23f40633 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-09T15:19:10 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
cc60c63645
commit
0af9477392
|
@ -1,5 +1,9 @@
|
|||
2008-08-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
|
||||
-toolbar]): changed algoritm so that a delegate would really see
|
||||
what the owner would, depending on his/her rights.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart
|
||||
-lookupImap4BodyPartKey:inContext:]): find a class based on the
|
||||
mime type of the subpart described by the partInfo.
|
||||
|
|
|
@ -1545,7 +1545,8 @@ RANGE(2);
|
|||
|
||||
#warning the following methods probably share some code...
|
||||
- (NSString *) _toolbarForOwner: (SOGoUser *) ownerUser
|
||||
andClientObject: (SOGoCalendarComponent *) clientObject
|
||||
andClientObject: (SOGoContentObject
|
||||
<SOGoComponentOccurence> *) clientObject
|
||||
{
|
||||
NSString *toolbarFilename;
|
||||
iCalPersonPartStat participationStatus;
|
||||
|
@ -1576,7 +1577,8 @@ RANGE(2);
|
|||
}
|
||||
|
||||
- (NSString *) _toolbarForDelegate: (SOGoUser *) ownerUser
|
||||
andClientObject: (SOGoCalendarComponent *) clientObject
|
||||
andClientObject: (SOGoContentObject
|
||||
<SOGoComponentOccurence> *) clientObject
|
||||
{
|
||||
SoSecurityManager *sm;
|
||||
NSString *toolbarFilename, *adminToolbar;
|
||||
|
@ -1590,56 +1592,38 @@ RANGE(2);
|
|||
|
||||
currentUser = [context activeUser];
|
||||
sm = [SoSecurityManager sharedSecurityManager];
|
||||
if ([[component attendees] count])
|
||||
|
||||
if (![sm validatePermission: SOGoCalendarPerm_ModifyComponent
|
||||
onObject: clientObject
|
||||
inContext: context])
|
||||
toolbarFilename = [self _toolbarForOwner: ownerUser
|
||||
andClientObject: clientObject];
|
||||
else if (![sm validatePermission: SOGoCalendarPerm_RespondToComponent
|
||||
onObject: clientObject
|
||||
inContext: context]
|
||||
&& [[component attendees] count]
|
||||
&& [component userIsParticipant: ownerUser]
|
||||
&& ![component userIsOrganizer: ownerUser])
|
||||
{
|
||||
if ([component userIsOrganizer: currentUser])
|
||||
toolbarFilename = @"SOGoComponentClose.toolbar";
|
||||
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
|
||||
{
|
||||
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";
|
||||
}
|
||||
toolbarFilename = @"SOGoAppointmentObjectAcceptOrDecline.toolbar";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (![sm validatePermission: SOGoCalendarPerm_ModifyComponent
|
||||
onObject: clientObject
|
||||
inContext: context]
|
||||
|| [component userIsOrganizer: currentUser])
|
||||
toolbarFilename = adminToolbar;
|
||||
else
|
||||
toolbarFilename = @"SOGoComponentClose.toolbar";
|
||||
}
|
||||
toolbarFilename = @"SOGoComponentClose.toolbar";
|
||||
|
||||
return toolbarFilename;
|
||||
}
|
||||
|
||||
- (NSString *) toolbar
|
||||
{
|
||||
SOGoCalendarComponent *clientObject;
|
||||
SOGoContentObject <SOGoComponentOccurence> *clientObject;
|
||||
NSString *toolbarFilename;
|
||||
SOGoUser *ownerUser;
|
||||
|
||||
|
|
Loading…
Reference in a new issue