CheckAccessInterface.php 1.1 KB

123456789101112131415161718192021222324252627282930
  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. * For more details and usage information on CheckAccessInterface, see the [guide article on security authorization](guide:security-authorization).
  10. *
  11. * @author Sam Mousa <sam@mousa.nl>
  12. * @since 2.0.9
  13. */
  14. interface CheckAccessInterface
  15. {
  16. /**
  17. * Checks if the user has the specified permission.
  18. * @param string|int $userId the user ID. This should be either an integer or a string representing
  19. * the unique identifier of a user. See [[\yii\web\User::id]].
  20. * @param string $permissionName the name of the permission to be checked against
  21. * @param array $params name-value pairs that will be passed to the rules associated
  22. * with the roles and permissions assigned to the user.
  23. * @return bool whether the user has the specified permission.
  24. * @throws \yii\base\InvalidParamException if $permissionName does not refer to an existing permission
  25. */
  26. public function checkAccess($userId, $permissionName, $params = []);
  27. }