ItemSchema.EffectiveRights give wrong results

Hi all, somehow i stumbled into this problem today, and cant seem to fix it.

Situation:
EWS 1.1
Exchange 2007 SP3
.NET4 VS2010 SP1

Two normal accounts, no delegation/impersonation.
User A has Author permissions to user B calendar folder. User A wants to delete all appointments he has delete rights for.

// setup calendarview CalendarView calendarView = new CalendarView(DateTime.Today, DateTime.Today.AddMonths(1)); calendarView.PropertySet = new PropertySet(ItemSchema.ItemClass, ItemSchema.EffectiveRights, ItemSchema.Categories); //the actual ews call FindItemsResults<Appointment> findResults = CalendarFolder.Bind(service, calendarFolderId).FindAppointments(calendarView); foreach (Appointment appointment in findResults.Items) { if (appointment.EffectiveRights.HasFlag(EffectiveRights.Delete)) { // normally you would delete the appointments here

}
else { // i would expect i cannot delete the appointment here, in fact i can. That makes this effectiverights property useless
} }

Somehow the EffectiveRights flag is ALWAYS set to 'Read'.

I just want to be sure that if i delete an appointment, i actually have the rights to do that.


The response XML shows the effective rights, that only has read set to true while i expect delete to be true asswell :
               
<t:CalendarItem>                  
  <t:ItemId Id="{id}=" ChangeKey="DwAAABYAAACiMyJAq8rTRpj8V9OP3cCLAC+MueIa" />
  <t:ItemClass>IPM.Appointment</t:ItemClass>
  <t:Categories>
    <t:String>Digirooster</t:String>
  </t:Categories>
  <t:EffectiveRights>
    <t:CreateAssociated>false</t:CreateAssociated>
    <t:CreateContents>false</t:CreateContents>
    <t:CreateHierarchy>false</t:CreateHierarchy>
    <t:Delete>false</t:Delete>
    <t:Modify>false</t:Modify>
    <t:Read>true</t:Read>
  </t:EffectiveRights>                
</t:CalendarItem>


January 6th, 2012 4:29pm

Anyone? This problem is nagging...
Free Windows Admin Tool Kit Click here and download it now
February 21st, 2012 12:18am

Hi wnnb,

although this is already quite old I wanted to share a solution to your problem because we just solved this problem aswell.

The appointment-object alwas has the EffectiveRight-Attribute set to "Read" but not the underlying Item-Object. You can retrieve the item like this:

var item = Item.Bind(service, appointment.Id);
if (item.EffectiveRights.HasFlag(EffectiveRights.Delete))
{
// Delete Rights present
} else {
// No rights to delete
}


Kind regards,
Thomas Frhle
App-Developer-Hotline for MSDN Online Germany

Disclaimer:
Bitte haben Sie Verstndnis dafr, dass wir hier auf Rckfragen gar nicht oder nur sehr zeitverzgert antworten knnen.
Bitte nutzen Sie fr Rckfragen oder neue Fragen den telefonischen Weg ber die App-Entwickler-Hotline: http://www.msdn-online.de/Hotline
MSDN Hotline: Schnelle & kompetente Hilfe fr Entwickler: kostenfrei!

Es gelten fr die App-Entwickler-Hotline und dieses Posting diese Nutzungsbedingungen, Hinweise zu MarkenzeichenInformationen zur Datensicherheit sowie die gesonderten Nutzungsbedingungen fr die App-Entwickler-Hotline.

August 9th, 2013 11:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics