Skip to content

PermissionCli

PermissionCli is used by UnityCatalogCli to handle permission sub-commands.

$ ./bin/uc permission --help
Please provide a valid sub-command for permission.
Valid sub-commands for permission are: get, create, delete
For detailed help on permission sub-commands, use bin/uc permission <sub-command> --help

Note

Permissions and Privilege Assignments are synonyms.

Securable Types

There are the following types of the securables in Unity Catalog:

  1. catalog
  2. function
  3. metastore
  4. registered_model
  5. schema
  6. table
  7. volume

Handle Command Line

void handle(
  CommandLine cmd,
  ApiClient apiClient)

handle handles the given cmd.

handle creates a GrantsApi (with the given ApiClient).

Subcommand Handler API Handlers
create updatePermission GrantsApi
delete updatePermission GrantsApi
get getPermission GrantsApi

handle is used when:

Get Permission

String getPermission(
  GrantsApi grantsApi,
  JSONObject json)

getPermission handles get sub-command.

./bin/uc permission get --help
Usage: bin/uc permission get [options]
Required Params:
  --securable_type The type of the securable
  --name The name of the entity.
Optional Params:
  --server UC Server to connect to. Default is reference server.
  --auth_token PAT token to authorize uc requests.
  --output To indicate CLI output format preference. Supported values are json and jsonPretty.
  --principal The target principal of the permission change

getPermission extracts the following command-line options from the given JSONObject:

  • securable_type
  • name
  • principal

getPermission requests the GrantsApi for the privilege assignments of the given name (of securable_type type).