# CheckAccessInterface

> For more details and usage information on CheckAccessInterface, see the [guide article on security authorization](https://yii2-framework.github.io/docs/guide/security-authorization/).

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [rbac](/docs/api/yii/rbac/index.md) › CheckAccessInterface

| interface | `yii\rbac\CheckAccessInterface` |
| --- | --- |
| Since | 2.0.9 |
| Source | [`framework/rbac/CheckAccessInterface.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/rbac/CheckAccessInterface.php#L17) |

Implemented by 1 type:

- [`ManagerInterface`](/docs/api/yii/rbac/managerinterface/index.md)

For more details and usage information on CheckAccessInterface, see the [guide article on security authorization](/docs/guide/security-authorization/index.md).

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`checkAccess()`](#method-checkAccess) abstract | Checks if the user has the specified permission. | `CheckAccessInterface` |

## Method details

### checkAccess() <span id="method-checkAccess"></span>

```php
abstract public function checkAccess(string|int $userId, string $permissionName, array $params = []): bool
```

Checks if the user has the specified permission.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$userId` | `string\|int` | The user ID. This should be either an integer or a string representing the unique identifier of a user. See [`User::$id`](/docs/api/yii/web/user/index.md#property-id). |
| `$permissionName` | `string` | The name of the permission to be checked against |
| `$params` | `array` | Name-value pairs that will be passed to the rules associated with the roles and permissions assigned to the user. |

**Returns**

`bool`: Whether the user has the specified permission.

**Throws**

- [`yii\base\InvalidArgumentException`](/docs/api/yii/base/invalidargumentexception/index.md): if $permissionName does not refer to an existing permission