> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CHECK

[Users](https://docs.kinetica.com/content/security/sec_concepts.md#security-concepts-users) (or the current user) can have
their effective permissions checked, including:

* Role assignments
* Administrative permissions
* Object-level access

A result of `YES` or `NO` will be returned, based on whether the given user
has the specified permissions or not, either directly or through a role or
administrative access.
[Row/Column-level](https://docs.kinetica.com/content/sql/security/grant-table-permission.md#sql-security-priv-mgmt-row-grant) permission
information will be returned after the `YES`, if applicable.

```sql title="CHECK PERMISSION Syntax" theme={null}
CHECK <permission> [PERMISSION] [ON [<target type>] <target>]
[FOR <user>]
[IF EXISTS]
```

```sql title="CHECK ROLE Syntax" theme={null}
CHECK ROLE OF <role>
[FOR <user>]
[IF EXISTS]
```

## Parameters

> [accordion] \<permission>
>
> Permission to verify for the given user
>
> Supported permissions include:
>
> <table>
>   <thead>
>     <tr>
>       <th>Permission</th>
>       <th>Description</th>
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr>
>       <td>`ADMIN` | `ALL`</td>
>       <td>Applicable to [credential](https://docs.kinetica.com/content/sql/ddl/create-credential.md#sql-create-credential) objects and [tables](https://docs.kinetica.com/content/sql/ddl/create-table.md#sql-create-table) (or views)</td>
>     </tr>
>
>     <tr>
>       <td>`CONNECT`</td>
>       <td>Applicable to external [data sources](https://docs.kinetica.com/content/sql/ddl/create-data-source.md#sql-create-data-source)</td>
>     </tr>
>
>     <tr>
>       <td>`DELETE`</td>
>       <td>Applicable to [tables](https://docs.kinetica.com/content/sql/ddl/create-table.md#sql-create-table)</td>
>     </tr>
>
>     <tr>
>       <td>`EXECUTE`</td>
>       <td>Applicable to [User-Defined Functions](https://docs.kinetica.com/content/sql/udf.md#sql-udf) (UDFs) and SQL [stored procedures](https://docs.kinetica.com/content/sql/procedure.md#sql-procedures)</td>
>     </tr>
>
>     <tr>
>       <td>`INSERT`</td>
>       <td>Applicable to [tables](https://docs.kinetica.com/content/sql/ddl/create-table.md#sql-create-table)</td>
>     </tr>
>
>     <tr>
>       <td>`READ`</td>
>       <td>Applicable to [credential](https://docs.kinetica.com/content/sql/ddl/create-credential.md#sql-create-credential) objects</td>
>     </tr>
>
>     <tr>
>       <td>`SELECT`</td>
>       <td>Applicable to [tables](https://docs.kinetica.com/content/sql/ddl/create-table.md#sql-create-table) (or views)</td>
>     </tr>
>
>     <tr>
>       <td>`SYSTEM ADMIN`</td>
>       <td>[System admin](https://docs.kinetica.com/content/sql/security/grant-system-permission.md#sql-perm-system-admin) permission</td>
>     </tr>
>
>     <tr>
>       <td>`SYSTEM CREATE`</td>
>       <td>[System create](https://docs.kinetica.com/content/sql/security/grant-system-permission.md#sql-perm-system-mgmt) permission</td>
>     </tr>
>
>     <tr>
>       <td>`SYSTEM MONITOR`</td>
>       <td>[System monitor](https://docs.kinetica.com/content/sql/security/grant-system-permission.md#sql-perm-system-mgmt) permission</td>
>     </tr>
>
>     <tr>
>       <td>`SYSTEM READ`</td>
>       <td>[System read](https://docs.kinetica.com/content/sql/security/grant-system-permission.md#sql-perm-system-mgmt) permission</td>
>     </tr>
>
>     <tr>
>       <td>`SYSTEM WRITE`</td>
>       <td>[System write](https://docs.kinetica.com/content/sql/security/grant-system-permission.md#sql-perm-system-mgmt) permission</td>
>     </tr>
>
>     <tr>
>       <td>`UPDATE`</td>
>       <td>Applicable to [tables](https://docs.kinetica.com/content/sql/ddl/create-table.md#sql-create-table)</td>
>     </tr>
>
>     <tr>
>       <td>`USER ADMIN`</td>
>       <td>[User admin](https://docs.kinetica.com/content/sql/security/grant-system-permission.md#sql-perm-user-admin) permission</td>
>     </tr>
>   </tbody>
> </table>

> [accordion] PERMISSION
>
> Optional keyword for clarity

> [accordion] ON
>
> Keyword for specifying the optional *ON* clause, which checks for the specified `permission`
> on the following `target` (and optional `target type`) given in this clause

> [accordion] \<target type>
>
> Optional keyword for specifying the object type of the target; may be necessary to disambiguate
> same-named objects of differing types
>
> Supported target types include:
>
> <table>
>   <thead>
>     <tr>
>       <th>Target Type</th>
>       <th>Description</th>
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr>
>       <td>`CONTEXT`</td>
>       <td>[SQL-GPT context](https://docs.kinetica.com/content/sql/sqlgpt/create-context.md#sql-gpt-create-context) object</td>
>     </tr>
>
>     <tr>
>       <td>`CREDENTIAL`</td>
>       <td>[Credential](https://docs.kinetica.com/content/sql/ddl/create-credential.md#sql-create-credential) object</td>
>     </tr>
>
>     <tr>
>       <td>`DATA SINK`</td>
>       <td>External [data source](https://docs.kinetica.com/content/sql/ddl/create-data-source.md#sql-create-data-source)</td>
>     </tr>
>
>     <tr>
>       <td>`DATA SOURCE`</td>
>       <td>External [data source](https://docs.kinetica.com/content/sql/ddl/create-data-source.md#sql-create-data-source)</td>
>     </tr>
>
>     <tr>
>       <td>`DIRECTORY`</td>
>       <td>[KiFS](https://docs.kinetica.com/content/tools/kifs.md) directory</td>
>     </tr>
>
>     <tr>
>       <td>`FUNCTION`</td>
>       <td>[User-Defined Function](https://docs.kinetica.com/content/sql/udf.md#sql-udf) (UDF)</td>
>     </tr>
>
>     <tr>
>       <td>`GRAPH`</td>
>       <td>[Graph](https://docs.kinetica.com/content/sql/graph/create-graph.md#sql-graph-create)</td>
>     </tr>
>
>     <tr>
>       <td>`PROCEDURE`</td>
>       <td>SQL [stored procedure](https://docs.kinetica.com/content/sql/procedure.md#sql-procedures)</td>
>     </tr>
>
>     <tr>
>       <td>`SCHEMA`</td>
>       <td>[Schema](https://docs.kinetica.com/content/sql/ddl/create-schema.md#sql-create-schema)</td>
>     </tr>
>
>     <tr>
>       <td>`STREAM`</td>
>       <td>[Stream](https://docs.kinetica.com/content/sql/ddl/create-stream.md#sql-create-stream)</td>
>     </tr>
>
>     <tr>
>       <td>`TABLE`</td>
>       <td>[Table](https://docs.kinetica.com/content/sql/ddl/create-table.md#sql-create-table) (or view)</td>
>     </tr>
>   </tbody>
> </table>

> [accordion] \<target>
>
> Name of the object to which the given user's specified permission will be checked

> [accordion] \<role>
>
> Name of the role of which the given user's membership will be checked

> [accordion] FOR \<user>
>
> Optional *FOR* clause, which checks whether the specified permission/role exists for the `user`
> given in this clause; if omitted, the current user will be checked

> [accordion] IF EXISTS
>
> Optional error suppression clause, which causes the check to return `No` if any of the entities
> specified do not exist; without this clause, non-existent entities will return an error


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.