views:

51

answers:

1
+1  Q: 

Google Calendar

Hi I'm developing one web application project using java for education industry.In this Admin have all rights to access the google services of other users like A,B,C..... for this is use OAuth.Then i tried Admin want to share user A's calendar to user B using OAuth.But i got stuck in this step. Is it possible Plz Help me

Thanks Regards Sharun

+1  A: 

I believe you want to use Access Control Lists (ACLs), see the docs. The Java example code at this URL for the task you mention is pretty simple:

AclEntry entry = new AclEntry();
entry.setScope(new AclScope(AclScope.Type.USER, "[email protected]"));
entry.setRole(CalendarAclRole.READ);

URL aclUrl =
  new URL("http://www.google.com/calendar/feeds/[email protected]/acl/full");

AclEntry insertedEntry = service.insert(aclUrl, entry);

and what it does is, and I quote:

This code allows [email protected] to have read-only access to [email protected]'s calendar.

There's more where this came from (e.g., upgrading a user's role in an ACL above the read-only access granted in this example), and I think it's a good idea to read the whole page.

Alex Martelli