I'm wondering if this is possible to set the permissions of an additional calendar (sub folder of the build in Calendar folder) in a user's Exchange account in that way that the user is not able to create, edit or delete appointments.
I managed to create an additional calendar for the user with an impersonation account. The new calendar is accessible by the user. To revoke the permissions for the user on this folder, I set the permission level for the user on this folder to FolderPermissionLevel.Reviewer.
But when I tested the permissions on the new calendar, the user is still able to create, edit and 开发者_StackOverflow社区delete events in this calendar. At the moment I'm wondering if it is possible at all to revoke the permissions for this user as he is the owner of the whole account.
Here's the code I used.
ExchangeVersion exchVersion = new ExchangeVersion();
exchVersion = ExchangeVersion.Exchange2010;
ExchangeService service = new ExchangeService(exchVersion)
{
Credentials = new WebCredentials("impersonationAcc@example.com",
"password")
};
service.AutodiscoverUrl("impersonationAcc@example.com", url => true);
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress,
"user@example.com");
Folder addCalendar = new Folder(service);
addCalendar.DisplayName = "Another Calendar";
addCalendar.FolderClass = "IPF.Appointment";
var perm = new FolderPermission(new UserId("user@example.com"),
FolderPermissionLevel.Reviewer);
addCalendar.Permissions.Add(perm);
addCalendar.Save(WellKnownFolderName.Calendar);
Appointment app = new Appointment(service);
app.Subject = "Test Appointment";
app.Start = new DateTime(2011, 2, 14, 10, 0, 0);
app.End = new DateTime(2011, 2, 14, 11, 0, 0);
app.Body = "Content";
app.Save(addCalendar.Id);
After doing some more searching and posting in other forums, I found out that it is not possible to restrict the permissions on any kind of item (e.g. calendar or folder) for the owner an exchange account.
精彩评论