zcli role commands, with syntax and examples for each operation. A role defines what its users can do: which objects they can create, read, update, or delete, in which enterprises, and in which projects. You assign a role to a user with zcli user. See Manage Users.
This page is the command reference. For an explanation of role types and the permissions of the built-in System roles, see Manage Roles.
Before You Start
- ZCLI is installed and authenticated against your enterprise. See Get Started.
- You have the SysAdmin role in your enterprise. See Manage Roles.
- Any project that you plan to name in a project scope already exists. ZCLI looks up each project by name and rejects the command if a project is not found.
Access Right Format
You define a role’s permissions with--access-right. Each --access-right value is one scope: a comma-separated list of object:action pairs, plus optional enterprise-scope and project-scope entries that limit where those permissions apply. Enclose the whole value in quotes.
Objects
Actions
Combine the lettersc (create), r (read), u (update), and d (delete) to grant several permissions. Write the letters in c, r, u, d order. For example, ru, cru, and crud are valid, but ur and rc are not. Letters are not case-sensitive.
Any other combination of the four letters is also valid if the letters appear in c, r, u, d order, for example
rd or cud. There is no value for “no access”. To give a scope no access to an object, leave that object out of the scope.
Scopes
Keep the following rules in mind:
- Separate multiple project names with spaces, not commas, inside a single
project-scopeentry. Because ZCLI splits the list on spaces, a project whose name contains a space cannot be used in a project scope. - Use only
localorglobalforenterprise-scope. ZCLI passes any other value to Edge Infrastructure Services unchanged, without checking it. - To apply different permissions to different projects, repeat
--access-right. Each--access-rightvalue creates a separate scope with its own objects, actions, and filters.
Access right examples
Full access to nodes, edge applications, and application instances in one project, with read access to users:Create a Role
Create a custom role
Create a custom role with one or more scopes.--access-right is required.
ZCLI creates the role as a user-defined (custom) role.
Example:
View Roles
View a single role
Show one role by name or UUID, or show the role of the user who is logged in with--self. Add --detail to include the description, version, and creation and modification history.
E-Scopeshowslocalorglobal.P-Scopeshows the project names, orAllif the scope applies to all projects.- The access columns show the granted actions in uppercase, for example
CRUDorRU. An object that is not part of the scope is empty or showsNONE. - The
EntrpriseLevelObjectAccesscolumn, which corresponds toenterprise-integration-items, shows the full API value, for examplePermissionAccessCreateReadUpdateDelete, instead of letters.
List roles
Runzcli role show without a name to list all roles, including the built-in System roles. Use the following flags to filter the list.
To list all roles:
Operator:
Update a Role
Update a custom role
Update a role’s title, description, or access rights.--title or --description, ZCLI keeps the role’s existing scopes unchanged. If you pass no options, ZCLI prints Nothing to update. and makes no change.
Example: change only the title:
MY_PROJECT and read-only access in MY_PROJECT_B:
Delete a Role
Delete a custom role
Delete a role by name. ZCLI asksDelete role <name>? [Y/N] unless you pass -f. If you answer no, ZCLI prints Role <name> not deleted.
Next Steps
Manage Users
Create users and assign roles to them in one or more enterprises.
Manage Roles
Role types and the permissions of the built-in System roles.
Get Started
Install ZCLI, configure access to Edge Infrastructure Services, and sign in.
Overview
All ZCLI command procedures, organized by resource type.