Thanks for your answer.
> Do you know if this is only happening for secondary calendars or if this is
> also happening for primary calendars too?
⇒
It is happening for not primary calendars only.
To be precise, it's occured when inserting to other user's primary calendar.
>Also, can you tell us what authorization mechanism your application is using?
⇒
Yes, I use a authorization mecanism "Client Login".
The authorization user is a administrator account of the domain.
The target calendar is the other users primery calendar, the account
is administrator of the domain or not.
the follow code is the sample.
The error message "This feed is read-only" appeared at the "★" mark.
before, If the authorization user is the administrator of domain, the
user had the permission of edit calendar.
------------------------------------------------------------------------------
string strCalendarID = "targetuser1@mydomain";
string strAdminAccount = "admin@mydomain";
string strAdminPwd = "xxxxx";
CalendarService service = new CalendarService("myapp");
service.setUserCredentials(strAdminAccount, strAdminPwd);
string strFeedUri = "https://www.google.com/calendar/feeds/" +
strCalendarID + "/private/full/batch";
EventQuery query = new EventQuery(strFeedUri);
EventFeed feed = service.Query(query);
AtomFeed batchFeed = new AtomFeed(new Uri(strFeedUri), service);
int idx = 0;
foreach (EventEntry entry in feed.Entries)
{
// update sample
entry.Content.Content += "update";
entry.BatchData = new GDataBatchEntryData("UPDATE" + idx.ToString(),
GDataBatchOperationType.update);
batchFeed.Entries.Add(entry);
idx++;
}
// insert sample
EventEntry newEntry = createNewEntry();
newEntry.BatchData = new GDataBatchEntryData("INSERT",
GDataBatchOperationType.insert);
batchFeed.Entries.Add(newEntry);
EventFeed batchResultFeed = (EventFeed)service.Batch(batchFeed, new
Uri(strFeedUri));
bool success = true;
foreach (EventEntry entry in batchResultFeed.Entries)
{
if (entry.BatchData.Status.Code != 200 && entry.BatchData.Status.Code
!= 201)
{
success = false;
Console.WriteLine("[FAILED]" + "[" +
entry.BatchData.Status.Code +
"]" + entry.BatchData.Id + ":" + entry.BatchData.Status.Reason); //
←★
}
else
{
Console.WriteLine("[SUCCESS]" + "[" +
entry.BatchData.Status.Code +
"]" + entry.BatchData.Id + ":" + entry.BatchData.Status.Reason);
}
}
Console.WriteLine(success);
--
You received this message because you are subscribed to the Google
Groups "Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/calendar/community/forum.html