Perform bulk user access management
Grant or revoke access for multiple users at once.
Read time 5 minutesLast updated 2 days ago
To modify permissions for a set of users at once, use the
rbacrbacrbacOperation | Description |
|---|---|
| Assigns one role or one user type ( |
| Removes every role belonging to a suite ( |
Before you start
To manage acces, you need:- The ID of the target organization (a UUID-formatted string, like ). Find it with the
00000000-0000-0000-0000-000000000000command or in the organization properties in the Dashboard (go to Administration > Settings).orgs list - The e-mails or user IDs of the users to update.
- If the tool runs in the single-user mode (with the parameter), specity the e-mail or ID in the command line.
--user - If the tool runs in the multi-user mode (with the parameter), it reads these e-mails or IDs from a .txt file. The file contains one e-mail or user ID per line. You can include both e-mails and IDs for different users in the same file. The file's encoding must be
--file.utf-8
- If the tool runs in the single-user mode (with the
- No explicit authentication is required - the tool runs in-cluster and calls relevant APIs directly. Anyone who can execute in the solution namespace can change feature flags; treat
kubectl runaccess as the only access boundary.kubectl - The commands on this page work in a Unix-based shell (Linux, MacOS, WSL on Windows, Git Bash on Windows). If you need to run them in a Windows shell:
- Use PowerShell 7.3 or newer, not Windows PowerShell 5.x.
- Replace line continuation characters () with backticks (
\).`
Use cases
The examples in this section use the single-user form of therbacAssign an organization user type
To assign a user type run the following command:- Replace the string with the e-mail or user ID of the target user.
<email-or-id> - Replace the string with the organization's ID.
<organizationID> - Set the parameter to the required user type, either
--usertypeorOwner.User
kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ rbac assign \ --user <email-or-id> \ --org <organizationId> \ --usertype Owner
Assign a project user type
To assign a user type run the following command:- Replace the string with the e-mail or user ID of the target user.
<email-or-id> - Replace the string with the project's ID.
<projectId> - Set the parameter to the required user type, either
--usertypeorOwner.User
kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ rbac assign \ --user <email-or-id> \ --project <projectId> \ --usertype Owner
Assign an organization-level role
To assign an organization-level role run the following command:- Replace the string with the e-mail or user ID of the target user.
<email-or-id> - Replace the string with the organization's ID.
<organizationID> - Set the parameter to the required organization-level role, such as Asset Manager Admin, Automation User, or Automation Developer.
--role
kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ rbac assign \ --user <email-or-id> \ --org <organizationId> \ --role "Asset Manager Admin"
Assign a project-level role
To assign an project-level role run the following command:- Replace the string with the e-mail or user ID of the target user.
<email-or-id> - Replace the string with the project's ID.
<projectId> - Set the parameter to the required project-level role, such as Asset Manager Admin, Automation User, or Automation Developer.
--role
kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ rbac assign \ --user <email-or-id> \ --project <projectId> \ --role "Asset Manager Viewer"
Revoke all roles from a specific suite
rbac unassignamcautomation- Replace the string with the e-mail or user ID of the target user.
<email-or-id> - Replace the string with the organization's ID.
<organizationID>
kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ rbac unassign \ --user <email-or-id> \ --org <organizationId> \ --suite amc
Project level
To revoke all Asset Manager roles from a single user at the project level, run the following command:- Replace the string with the e-mail or user ID of the target user.
<email-or-id> - Replace the string with the project's ID.
<projectId>
The tool fetches the user's current roles, removes those belonging to the named suite, and submits the remaining set. Roles outside the suite (for example, Pipeline Automation roles when you unassign thekubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ rbac unassign \ --user <email-or-id> \ --project <projectId> \ --suite automation
amcRunning rbac on multiple users at once
If you need to perform anrbac assign/unassignkubectl run- Have .txt extension.
- Use encoding.
utf-8 - Contain one e-mail or user ID per line.
alice@example.combob@example.comcarol@example.com
First method: Multiple single-user invocations without a file
For small batches, call the tool once for each user with a loop. For example, on a Unix-based shell (Linux, MacOS, WSL on Windows, Git Bash on Windows):for EMAIL in alice@example.com bob@example.com carol@example.com ; do kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ rbac assign \ --user "$EMAIL" \ --org <organizationId> \ --usertype Ownerdone
Second method: Stage the .txt file as a ConfigMap and mount it into the pod
When the batch is too large for a loop:- Ship the file with a ConfigMa.
- Extend to mount the file. Replace
--overrideswith the required organization's ID:<organizationId>
When the operation is complete, delete the ConfigMap:kubectl create configmap upc-cli-input -n asset-solutions --from-file users.txtkubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions --restart=Never \ --overrides='{ "spec": { "imagePullSecrets": [{"name": "acr-unity-registry"}], "containers": [{ "name": "upc-cli", "image": "uccmpprivatecloud.azurecr.io/docker/upc-cli:latest", "args": ["--path-prefix","","--fqdn","http://mini-usf:8080","--no-auth", "rbac","assign","--file","/input/users.txt","--org","<organizationId>","--usertype","Owner"], "volumeMounts": [{"name":"input","mountPath":"/input"}] }], "volumes": [{"name":"input","configMap":{"name":"upc-cli-input"}}] } }'
kubectl delete configmap upc-cli-input -n asset-solutions
The tool output
On success, upc-cli prints a JSON summary listing the resolved user IDs and the API responses for each user. For example:Unresolved users appear as a warning line on stderr before the JSON summary. They don't abort the run:{ "assignedRoleId": "e5411482-bf96-4166-a1e5-07726894b8b5", "users": [ "80711ff6-57c3-4a56-88bc-9c5827b3fbf4", "41fba0fd-4e1b-4954-9e05-6488c356b242" ], "results": [ { "status": 200 }, { "status": 200 } ]}
⚠️ Could not resolve user 'nosuchuser@example.com' to an id; skipping.
Parameter summary for rbac assign
and rbac unassign
rbac assignrbac unassignParameter | Required | Notes |
|---|---|---|
| Either | Single-user mode |
| Either | Should point to a .txt file. This file should contain one e-mail or user ID per line (the same file can contain both e-mails and IDs for different users) and use |
| Either | For organization-level operations |
| Either | For project-level operations |
| Either | |
| Either | |
| Required (and applicable) for the | |