Skip to main content

List Permissions

List on-chain permissions (Issuer, Verifier, Grantors, Ecosystem, Holder) for all credential schemas. Use the CLI today; the Indexer will provide richer server-side filters.

Query Parameters

At the moment, the CLI query does not accept filter flags. Use client-side filters (examples below). The Indexer will expose parameters such as schema_id, type, status, and grantee.

Useful fields in the response

FieldDescription
idPermission ID
schema_idCredential Schema ID this permission belongs to
typeRole type (see mapping below)
granteeDID or account that holds the permission
didDID registered in the permission (verifiable service)
statusPENDING, VALIDATED, TERMINATED, or REVOKED

Type mapping

The CLI/REST output returns enum strings (e.g., ISSUER), not numbers. Legacy docs sometimes refer to numeric IDs; both are listed here for reference.

Enum stringMeaningLegacy ID
ISSUERISSUER1
VERIFIERVERIFIER2
ISSUER_GRANTORISSUER-GRANTOR3
VERIFIER_GRANTORVERIFIER-GRANTOR4
ECOSYSTEMECOSYSTEM5
HOLDERHOLDER6

Execute the Query

Set up your environment (if not already):

NODE_RPC=http://node1.testnet.verana.network:26657

List all permissions

veranad q perm list-permissions --node $NODE_RPC --output json

Filter examples (client-side with jq)

  • By schema:
veranad q perm list-permissions --node $NODE_RPC --output json \
| jq '.permissions[] | select(.schema_id == "5")'
  • By type = ISSUER:
veranad q perm list-permissions --node $NODE_RPC --output json \
| jq '.permissions[] | select(.type == "ISSUER")'
# Alternatively, match by suffix (works across enum names)
veranad q perm list-permissions --node $NODE_RPC --output json \
| jq 'select(.permissions != null) | .permissions[] | select(.type | endswith("ISSUER"))'

Why type == "1" didn’t work? The .type field is an enum string (e.g., ISSUER), not a numeric ID. Use the string value (or the endswith("ISSUER") helper) when filtering with jq.

  • By status = VALIDATED:
veranad q perm list-permissions --node $NODE_RPC --output json \
| jq '.permissions[] | select(.status == "VALIDATED")'
  • By grantee DID:
DID=did:example:123456789abcdefghi
veranad q perm list-permissions --node $NODE_RPC --output json \
| jq --arg did "$DID" '.permissions[] | select(.did == $did)'
  • By grantee Account Address:
GRANTEE=verana1sxau0xyttphpck7vhlvt8s82ez70nlzw2mhya0
veranad q perm list-permissions --node $NODE_RPC --output json \
| jq --arg grantee "$GRANTEE" '.permissions[] | select(.grantee == $grantee)'
  • Count per type:
veranad q perm list-permissions --node $NODE_RPC --output json \
| jq -r '.permissions[].type' | sort | uniq -c