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:
Wolfgang Sourdeau 2008-08-09 15:19:10 +00:00
parent cc60c63645
commit 0af9477392
2 changed files with 30 additions and 42 deletions

View file

@ -1,5 +1,9 @@
2008-08-09 Wolfgang Sourdeau <wsourdeau@inverse.ca> 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 * SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart
-lookupImap4BodyPartKey:inContext:]): find a class based on the -lookupImap4BodyPartKey:inContext:]): find a class based on the
mime type of the subpart described by the partInfo. mime type of the subpart described by the partInfo.

View file

@ -1545,7 +1545,8 @@ RANGE(2);
#warning the following methods probably share some code... #warning the following methods probably share some code...
- (NSString *) _toolbarForOwner: (SOGoUser *) ownerUser - (NSString *) _toolbarForOwner: (SOGoUser *) ownerUser
andClientObject: (SOGoCalendarComponent *) clientObject andClientObject: (SOGoContentObject
<SOGoComponentOccurence> *) clientObject
{ {
NSString *toolbarFilename; NSString *toolbarFilename;
iCalPersonPartStat participationStatus; iCalPersonPartStat participationStatus;
@ -1576,7 +1577,8 @@ RANGE(2);
} }
- (NSString *) _toolbarForDelegate: (SOGoUser *) ownerUser - (NSString *) _toolbarForDelegate: (SOGoUser *) ownerUser
andClientObject: (SOGoCalendarComponent *) clientObject andClientObject: (SOGoContentObject
<SOGoComponentOccurence> *) clientObject
{ {
SoSecurityManager *sm; SoSecurityManager *sm;
NSString *toolbarFilename, *adminToolbar; NSString *toolbarFilename, *adminToolbar;
@ -1590,24 +1592,18 @@ RANGE(2);
currentUser = [context activeUser]; currentUser = [context activeUser];
sm = [SoSecurityManager sharedSecurityManager]; sm = [SoSecurityManager sharedSecurityManager];
if ([[component attendees] count])
{ if (![sm validatePermission: SOGoCalendarPerm_ModifyComponent
if ([component userIsOrganizer: currentUser])
toolbarFilename = @"SOGoComponentClose.toolbar";
else
{
if ([component userIsOrganizer: ownerUser]
&& ![sm validatePermission: SOGoCalendarPerm_ModifyComponent
onObject: clientObject onObject: clientObject
inContext: context]) inContext: context])
toolbarFilename = adminToolbar; toolbarFilename = [self _toolbarForOwner: ownerUser
else if ([component userIsParticipant: ownerUser] andClientObject: clientObject];
&& !([sm validatePermission: SOGoCalendarPerm_RespondToComponent else if (![sm validatePermission: SOGoCalendarPerm_RespondToComponent
onObject: clientObject onObject: clientObject
inContext: context] inContext: context]
&& [sm validatePermission: SOGoCalendarPerm_ModifyComponent && [[component attendees] count]
onObject: clientObject && [component userIsParticipant: ownerUser]
inContext: context])) && ![component userIsOrganizer: ownerUser])
{ {
participationStatus participationStatus
= [[component findParticipant: ownerUser] participationStatus]; = [[component findParticipant: ownerUser] participationStatus];
@ -1621,25 +1617,13 @@ RANGE(2);
} }
else else
toolbarFilename = @"SOGoComponentClose.toolbar"; toolbarFilename = @"SOGoComponentClose.toolbar";
}
}
else
{
if (![sm validatePermission: SOGoCalendarPerm_ModifyComponent
onObject: clientObject
inContext: context]
|| [component userIsOrganizer: currentUser])
toolbarFilename = adminToolbar;
else
toolbarFilename = @"SOGoComponentClose.toolbar";
}
return toolbarFilename; return toolbarFilename;
} }
- (NSString *) toolbar - (NSString *) toolbar
{ {
SOGoCalendarComponent *clientObject; SOGoContentObject <SOGoComponentOccurence> *clientObject;
NSString *toolbarFilename; NSString *toolbarFilename;
SOGoUser *ownerUser; SOGoUser *ownerUser;