roryqi commented on code in PR #12288:
URL: https://github.com/apache/gravitino/pull/12288#discussion_r3795788889


##########
docs/security/access-control.md:
##########
@@ -270,6 +270,66 @@ object: the owner of the table or view, plus 
`CREATE_TABLE` or `CREATE_VIEW` on
 | Job template | `REGISTER_JOB_TEMPLATE` | `USE_JOB_TEMPLATE`                  
   | Owner           | Run a job: `RUN_JOB` and `USE_JOB_TEMPLATE` |
 | Job          |                         | Owner                               
   | Owner           |                                           |
 
+Bulk user access-control APIs use the same privileges as the matching 
single-user operations. These
+bulk operations are authorized once before processing the request. Bulk user 
add requests report
+item-level failures in `errors`.
+
+| API                                                 | Required privilege     
                     | Request field |
+|-----------------------------------------------------|---------------------------------------------|---------------|
+| `POST /api/bulk/metalakes/{metalake}/users/add`     | `OWNER` of the 
metalake or `MANAGE_USERS`   | `users`       |
+| `POST /api/bulk/metalakes/{metalake}/users/remove`  | `OWNER` of the 
metalake or `MANAGE_USERS`   | `names`       |
+
+For example, add users in bulk:
+
+```shell
+curl -X POST "http://localhost:8090/api/bulk/metalakes/{metalake}/users/add"; \
+  -H "Authorization: Bearer $MANAGER_TOKEN" \
+  -H "Accept: application/vnd.gravitino.v1+json" \
+  -H "Content-Type: application/json" \
+  -d '{
+  "users": [
+    {"name": "analyst"},
+    {"name": "developer", "externalId": "[email protected]", "enabled": 
true}
+  ]
+}'
+```
+
+Remove users in bulk:
+
+```shell
+curl -X POST 
"http://localhost:8090/api/bulk/metalakes/{metalake}/users/remove"; \
+  -H "Authorization: Bearer $MANAGER_TOKEN" \
+  -H "Accept: application/vnd.gravitino.v1+json" \
+  -H "Content-Type: application/json" \
+  -d '{
+  "names": ["analyst", "developer"]
+}'
+```
+
+The same bulk add request can be sent from Java with `HttpClient`:

Review Comment:
   We should use Gravitino Java client here. But we maybe don't need the Java 
client API here. Java client is used for the connector. It's ok not to add the 
API to the Gravitino Java client. 
   But we should remove the document here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to