Create, update, delete, and query access control rules to calendars' resources.
To query access control rules of all calendars you can execute a query as below.
SELECT * FROM [AccessControlRules]
The CalendarId, and Id and CalendarId (both specified at the same time) columns support server side filtering only for the = operator.
To query the access control rules of a certain calendar you will need to specify the CalendarId as a WHERE clause criterion.
SELECT * FROM [AccessControlRules] WHERE CalendarId = 'firstname.lastname@example.org'
To query a specific access control rule of a certain calendar you will need to specify the CalendarId and Id as WHERE clause criteria.
SELECT * FROM [AccessControlRules] WHERE CalendarId = 'email@example.com' AND Id = 'domain:cdatatest.page'
To add a new access control rule to a specific calendar, for example to share the calendar with a user, group or domain, or to make the calendar publicly available (ScopeType='default'), you will need to at least specify the CalendarId, Role, ScopeType and optionally the ScopeValue (required if you haven't specified the default ScopeType).
For example, to share a calendar with a specific user you can execute a query as below.
INSERT INTO [AccessControlRules] (CalendarId, Role, ScopeType, ScopeValue) VALUES ('firstname.lastname@example.org', 'writer', 'user', 'email@example.com')
For example, to share a calendar with a specific domain you can execute a query as below.
INSERT INTO [AccessControlRules] (calendarId, Role, ScopeType, ScopeValue, SendNotification) VALUES ('firstname.lastname@example.org', 'writer', 'domain', 'cdatatest.page', 'true')
Note: Sharing a calendar with a user no longer automatically inserts the calendar into their CalendarList. If the user should be able to perform CRUD operations on the shared calendar, they will need to execute an INSERT statement by specifying at least the existing CalendarId in the statement. For more information, refer to the Calendars table section.
To update an access control rule of a specific calendar, you will need to specify the CalendarId along with the Id in the WHERE clause criteria.
UPDATE [AccessControlRules] SET Role = 'writer', ScopeType = 'user' WHERE Id = 'user:email@example.com' AND CalendarId = 'firstname.lastname@example.org'
To delete an access control rule from a specific calendar, you will need to specify the CalendarId along with the Id in the WHERE clause criteria.
DELETE FROM [AccessControlRules] WHERE Id = 'user:email@example.com' AND CalendarId = 'firstname.lastname@example.org'
The calendar identifier.
The identifier of the ACL rule.
The ETag of the resource.
The type of the resource.
The role assigned to the scope. Possible values are: none, freeBusyReader, reader, writer and owner.
The type of the scope. Possible values are: default, user, group and domain.
The email address of a user or group, or the name of a domain, depending on the scope type. Not applicable for type 'default'.
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
This value sets whether or not to send notifications about the calendar sharing change.
The default value is True.