yii2
1<?php
2/**
3* @link https://www.yiiframework.com/
4* @copyright Copyright (c) 2008 Yii Software LLC
5* @license https://www.yiiframework.com/license/
6*/
7
8namespace yii\rbac;
9
10/**
11* For more details and usage information on CheckAccessInterface, see the [guide article on security authorization](guide:security-authorization).
12*
13* @author Sam Mousa <sam@mousa.nl>
14* @since 2.0.9
15*/
16interface CheckAccessInterface
17{
18/**
19* Checks if the user has the specified permission.
20* @param string|int $userId the user ID. This should be either an integer or a string representing
21* the unique identifier of a user. See [[\yii\web\User::id]].
22* @param string $permissionName the name of the permission to be checked against
23* @param array $params name-value pairs that will be passed to the rules associated
24* with the roles and permissions assigned to the user.
25* @return bool whether the user has the specified permission.
26* @throws \yii\base\InvalidParamException if $permissionName does not refer to an existing permission
27*/
28public function checkAccess($userId, $permissionName, $params = []);
29}
30