You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1000B

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