AccessControlRules
Create, update, delete, and query access control rules to calendars' resources.
Table-Specific Information
Select
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 = '[email protected]'
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 protected]' AND Id = 'domain:cdatatest.page'
Insert
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 ('[email protected]', 'writer', 'user', '[email protected]')
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 ('[email protected]', '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.
Update
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 protected]' AND CalendarId = '[email protected]'
Delete
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 protected]' AND CalendarId = '[email protected]'
Columns
Name | Type | ReadOnly | Description |
CalendarId [KEY] | String | False |
The calendar identifier. |
Id [KEY] | String | True |
The identifier of the ACL rule. |
Etag | String | True |
The ETag of the resource. |
Kind | String | True |
The type of the resource. |
Role | String | False |
The role assigned to the scope. Possible values are: none, freeBusyReader, reader, writer and owner. |
ScopeType | String | False |
The type of the scope. Possible values are: default, user, group and domain. |
ScopeValue | String | False |
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-Columns
SELECT ステートメントのWHERE 句では、疑似カラムフィールドを使用して、データソースから返されるタプルを詳細に制御することができます。
Name | Type | Description |
SendNotification | String |
This value sets whether or not to send notifications about the calendar sharing change. デフォルト値はTrueです。 |