使用自定义字段将用户列为非管理员
List users as non admin with custom fields
根据有关架构的 the documentation, I should be able to get a list of users with a custom schema as long as the field in the schema has a value of ALL_DOMAIN_USERS
in the readAccessType
property. That is the exact set up I have in the admin console; Moreover, when I perform a get request to the schema get endpoint,我确认架构字段在 readAccessType
属性.[=19= 中设置为 ALL_DOMAIN_USERS
]
问题是当我执行 users list request 时,我没有在响应中获得自定义架构。请求如下:
GET /admin/directory/v1/users?customer=my_customer&projection=full&query=franc&viewType=domain_public
HTTP/1.1
Host: www.googleapis.com
Content-length: 0
Authorization: Bearer fakeTokena0AfH6SMD6jF2DwJbgiDZ
我得到的回复如下:
{
"nextPageToken": "tokenData",
"kind": "admin#directory#users",
"etag": "etagData",
"users": [
{
"externalIds": [
{
"type": "organization",
"value": "value"
}
],
"organizations": [
{
"department": "department",
"customType": "",
"name": "Name",
"title": "Title"
}
],
"kind": "admin#directory#user",
"name": {
"fullName": "Full Name",
"givenName": "Full",
"familyName": "Name"
},
"phones": [
{
"type": "work",
"value": "(999)999-9999"
}
],
"thumbnailPhotoUrl": "https://photolinkurl",
"primaryEmail": "user@domain.com",
"relations": [
{
"type": "manager",
"value": "user@domain.com"
}
],
"emails": [
{
"primary": true,
"address": "user@domain.com"
}
],
"etag": "etagData",
"thumbnailPhotoEtag": "photoEtagData",
"id": "xxxxxxxxxxxxxxxxxx",
"addresses": [
{
"locality": "Locality",
"region": "XX",
"formatted": "999 Some St Some State 99999",
"primary": true,
"streetAddress": "999 Some St",
"postalCode": "99999",
"type": "work"
}
]
}
]
}
但是,如果我对超级管理员用户执行相同的请求,我会在响应中得到额外的 属性:
"customSchemas": {
"Dir": {
"fieldOne": false,
"fieldTwo": "value",
"fieldThree": value
}
}
我的理解是,只要自定义架构字段设置为对所有域用户可见,我就应该使用非管理员用户获取自定义架构。这没有发生。我打开了 G Suite 的支持票,但提供“支持”的人向我发送了这个方向。我认为这是一个错误,或者我可能忽略了什么。
我联系了 G Suite 支持,事实上,这个问题是特定于域的问题。
Google 的支持工程师花了几个星期才解决这个问题,但最终得到了解决。该行为现在是预期的行为。
根据有关架构的 the documentation, I should be able to get a list of users with a custom schema as long as the field in the schema has a value of ALL_DOMAIN_USERS
in the readAccessType
property. That is the exact set up I have in the admin console; Moreover, when I perform a get request to the schema get endpoint,我确认架构字段在 readAccessType
属性.[=19= 中设置为 ALL_DOMAIN_USERS
]
问题是当我执行 users list request 时,我没有在响应中获得自定义架构。请求如下:
GET /admin/directory/v1/users?customer=my_customer&projection=full&query=franc&viewType=domain_public
HTTP/1.1
Host: www.googleapis.com
Content-length: 0
Authorization: Bearer fakeTokena0AfH6SMD6jF2DwJbgiDZ
我得到的回复如下:
{
"nextPageToken": "tokenData",
"kind": "admin#directory#users",
"etag": "etagData",
"users": [
{
"externalIds": [
{
"type": "organization",
"value": "value"
}
],
"organizations": [
{
"department": "department",
"customType": "",
"name": "Name",
"title": "Title"
}
],
"kind": "admin#directory#user",
"name": {
"fullName": "Full Name",
"givenName": "Full",
"familyName": "Name"
},
"phones": [
{
"type": "work",
"value": "(999)999-9999"
}
],
"thumbnailPhotoUrl": "https://photolinkurl",
"primaryEmail": "user@domain.com",
"relations": [
{
"type": "manager",
"value": "user@domain.com"
}
],
"emails": [
{
"primary": true,
"address": "user@domain.com"
}
],
"etag": "etagData",
"thumbnailPhotoEtag": "photoEtagData",
"id": "xxxxxxxxxxxxxxxxxx",
"addresses": [
{
"locality": "Locality",
"region": "XX",
"formatted": "999 Some St Some State 99999",
"primary": true,
"streetAddress": "999 Some St",
"postalCode": "99999",
"type": "work"
}
]
}
]
}
但是,如果我对超级管理员用户执行相同的请求,我会在响应中得到额外的 属性:
"customSchemas": {
"Dir": {
"fieldOne": false,
"fieldTwo": "value",
"fieldThree": value
}
}
我的理解是,只要自定义架构字段设置为对所有域用户可见,我就应该使用非管理员用户获取自定义架构。这没有发生。我打开了 G Suite 的支持票,但提供“支持”的人向我发送了这个方向。我认为这是一个错误,或者我可能忽略了什么。
我联系了 G Suite 支持,事实上,这个问题是特定于域的问题。
Google 的支持工程师花了几个星期才解决这个问题,但最终得到了解决。该行为现在是预期的行为。