Permissions API schema

service.permissions.graphqls

To authenticate API requests, you’ll need an API token. Learn how to generate an access token.

See usage examples in the cloudbeaver-graphql-examples repository.

You can try queries in the built-in GraphQL console, available on your server at https://your-server-address/api/gql/console. This tool lets you test requests directly from your browser.

For a live example, see the demo GraphQL console.

API Endpoints
https://your-server-address/api/gql

Queries

permissionsDefaults

Description

Returns global permission definitions and their default state

Response

Returns a ProductSettings!

Example

Query
query permissionsDefaults {
  permissionsDefaults {
    groups {
      ...ProductSettingsGroupFragment
    }
    settings {
      ...ObjectPropertyInfoFragment
    }
  }
}
Response
{
  "data": {
    "permissionsDefaults": {
      "groups": [ProductSettingsGroup],
      "settings": [ObjectPropertyInfo]
    }
  }
}

permissionsDefaultsState

Description

provides the actual default values (enabled/disabled) for global permissions that apply when a subject has no explicit override. These values can be modified via the mutation permissionsSetDefaults

Response

Returns [SMGlobalPermissionGrant!]!

Example

Query
query permissionsDefaultsState {
  permissionsDefaultsState {
    permission {
      ...SMGlobalPermissionStateFragment
    }
    subject {
      ...SMSubjectFragment
    }
  }
}
Response
{
  "data": {
    "permissionsDefaultsState": [
      {
        "permission": SMGlobalPermissionState,
        "subject": SMSubject
      }
    ]
  }
}

permissionsGrantedToSubject

Description

Returns the global permissions granted to the specified subject (user or team)

Response

Returns [SMGlobalPermissionGrant!]!

Arguments
Name Description
subjectId - ID!

Example

Query
query permissionsGrantedToSubject($subjectId: ID!) {
  permissionsGrantedToSubject(subjectId: $subjectId) {
    permission {
      ...SMGlobalPermissionStateFragment
    }
    subject {
      ...SMSubjectFragment
    }
  }
}
Variables
{"subjectId": "<id>"}
Response
{
  "data": {
    "permissionsGrantedToSubject": [
      {
        "permission": SMGlobalPermissionState,
        "subject": SMSubject
      }
    ]
  }
}

Mutations

permissionsGrantToSubject

Description

Overrides the default global permission state for a specific subject (user or team)

Response

Returns [SMGlobalPermissionGrant!]!

Arguments
Name Description
subjectId - ID!
permissions - [SMGlobalPermissionGrantInput!]!

Example

Query
mutation permissionsGrantToSubject(
  $subjectId: ID!,
  $permissions: [SMGlobalPermissionGrantInput!]!
) {
  permissionsGrantToSubject(
    subjectId: $subjectId,
    permissions: $permissions
  ) {
    permission {
      ...SMGlobalPermissionStateFragment
    }
    subject {
      ...SMSubjectFragment
    }
  }
}
Variables
{
  "subjectId": "<id>",
  "permissions": [SMGlobalPermissionGrantInput]
}
Response
{
  "data": {
    "permissionsGrantToSubject": [
      {
        "permission": SMGlobalPermissionState,
        "subject": SMSubject
      }
    ]
  }
}

permissionsSetDefaults

Description

Updates the default global permission values

Response

Returns [SMGlobalPermissionGrant!]!

Arguments
Name Description
permissions - [SMGlobalPermissionGrantInput!]!

Example

Query
mutation permissionsSetDefaults($permissions: [SMGlobalPermissionGrantInput!]!) {
  permissionsSetDefaults(permissions: $permissions) {
    permission {
      ...SMGlobalPermissionStateFragment
    }
    subject {
      ...SMSubjectFragment
    }
  }
}
Variables
{"permissions": [SMGlobalPermissionGrantInput]}
Response
{
  "data": {
    "permissionsSetDefaults": [
      {
        "permission": SMGlobalPermissionState,
        "subject": SMSubject
      }
    ]
  }
}

Types

AdminSubjectType

Description

Describes the type of the administrative subject (user or team)

Values
Enum Value Description

user

User

team

Team
Example
"user"

Boolean

Description

The Boolean scalar type represents true or false.

Example
"<boolean>"

Condition

Description

Represents a dynamic condition for a property, such as visibility or read-only state

Fields
Field Name Description
expression - String! The logical expression that defines when the condition applies
conditionType - ConditionType! The type of condition (e.g., HIDE or READ_ONLY)
Example
{"expression": "<string>", "conditionType": "HIDE"}

ConditionType

Values
Enum Value Description

HIDE

hiding property condition

READ_ONLY

restriction for setting a property value
Example
"HIDE"

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
"<id>"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
"<int>"

Object

Description

Any object (JSON)

Example
"<object>"

ObjectPropertyInfo

Description

Information about the object property used to generate its UI

Fields
Field Name Description
id - String Unique property identifier
displayName - String Human-readable name
description - String Property description
hint - String Usage hint for the property
category - String Property category (may be used if object has a lot of properties)
dataType - String Property data type (e.g., int, String)
value - Object Property value (can be resource-intensive for some properties, e.g., RowCount for tables)
validValues - [Object] List of allowed values (for enumerable properties)
defaultValue - Object Default property value
length - ObjectPropertyLength! Property value length
features - [String!]! List of supported features (e.g., system, hidden, inherited, foreign, expensive)
order - Int! Order position
supportedConfigurationTypes - [String!] Supported configuration types (for driver properties)
required - Boolean! Is the property required
scopes - [String!] List of preference scopes (e.g., global, user)
conditions - [Condition!] Dynamic conditions for the property (e.g., visibility or read-only)
Example
{
  "id": "<string>",
  "displayName": "<string>",
  "description": "<string>",
  "hint": "<string>",
  "category": "<string>",
  "dataType": "<string>",
  "value": "<object>",
  "validValues": ["<object>"],
  "defaultValue": "<object>",
  "length": "TINY",
  "features": ["<string>"],
  "order": "<int>",
  "supportedConfigurationTypes": ["<string>"],
  "required": "<boolean>",
  "scopes": ["<string>"],
  "conditions": [Condition]
}

ObjectPropertyLength

Values
Enum Value Description

TINY

1 character

SHORT

20 characters

MEDIUM

<= 64 characters

LONG

Full line length. The default

MULTILINE

Multi-line long text
Example
"TINY"

ProductSettings

Fields
Field Name Description
groups - [ProductSettingsGroup!]!
settings - [ObjectPropertyInfo!]! each property is associated with a group by category
Example
{
  "groups": [ProductSettingsGroup],
  "settings": [ObjectPropertyInfo]
}

ProductSettingsGroup

Fields
Field Name Description
id - ID!
displayName - String!
Example
{"id": "<id>", "displayName": "<string>"}

SMGlobalPermissionGrant

Fields
Field Name Description
permission - SMGlobalPermissionState! Permission state
subject - SMSubject The subject to which this permission is granted. May be null when used with defaults
Example
{
  "permission": SMGlobalPermissionState,
  "subject": SMSubject
}

SMGlobalPermissionGrantInput

Fields
Input Field Description
id - ID! Unique identifier of the permission
enabled - Boolean! New permission state
Example
{"id": "<id>", "enabled": "<boolean>"}

SMGlobalPermissionState

Fields
Field Name Description
id - ID! Unique identifier of the permission
enabled - Boolean! Indicates whether the permission is currently enabled or disabled
Example
{"id": "<id>", "enabled": "<boolean>"}

SMSubject

Fields
Field Name Description
subjectId - ID! Unique ID of the subject
subjectType - AdminSubjectType! Type: user or team
Example
{"subjectId": "<id>", "subjectType": "user"}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"<string>"