为 printerShare 创建 allowedUser

命名空间:microsoft.graph

授予指定用户向关联的 printerShare 提交打印 作业的权限

权限

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限

若要使用通用打印服务,除了下表中列出的权限之外,用户或应用的租户还必须具有活动的通用打印订阅。 登录的用户必须是打印机 管理员

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) PrinterShare.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序 不支持。

HTTP 请求

POST /print/shares/{printerShareId}/allowedUsers/$ref

请求标头

名称 说明
Authorization Bearer {token}。必需。
Content-Type application/json. Required.

请求正文

在请求正文中,使用 格式提供对用户实体的引用, @odata.id 如以下示例所示。

响应

如果成功,此方法返回 204 No Content 响应代码。

示例

请求

POST https://graph.microsoft.com/v1.0/print/shares/{printerShareId}/allowedUsers/$ref
Content-Type: application/json

{
  "@odata.id": "https://graph.microsoft.com/v1.0/users/{userId}"
}

响应

HTTP/1.1 204 No Content