question

DomenicHelfenstein-2115 avatar image
0 Votes"
DomenicHelfenstein-2115 asked HarmeetSinghMSFT-7172 answered

How to create a read-only calendar with Microsoft Graph API?

Using the following code

var calendarToCreate = new Calendar
{
    Name = "My read-only calendar",
    CanEdit = false,
    IsRemovable = false,
};

await graphClient
    .Users["my@email.com"]
    .Calendars
    .Request()
    .AddAsync(calendarToCreate);


the created calendar has CanEdit and IsRemovable both set to true instead of false.

What am I doing wrong?

microsoft-graph-calendar
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

HarmeetSinghMSFT-7172 avatar image
0 Votes"
HarmeetSinghMSFT-7172 answered

Hi @DomenicHelfenstein-2115

Calendar creation automatically sets canEdit property to true for the user who is creating the calendar.

184190-canedit01.png

You can refer to this article to know more.

isRemovable is default set to true for all users as they can be removed/deleted from the Sharee and Delegate list except for ‘My Organization User’ as its the deciding authority of which permissions are assigned to what user.

184199-isremovable1.png

You can refer this documentation to know more.

Hope this helps!

If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".


canedit01.png (27.8 KiB)
isremovable1.png (39.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.