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.

преди 8 години
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. use yii\base\Object;
  9. /**
  10. * Rule represents a business constraint that may be associated with a role, permission or assignment.
  11. *
  12. * @author Alexander Makarov <sam@rmcreative.ru>
  13. * @since 2.0
  14. */
  15. abstract class Rule extends Object
  16. {
  17. /**
  18. * @var string name of the rule
  19. */
  20. public $name;
  21. /**
  22. * @var integer UNIX timestamp representing the rule creation time
  23. */
  24. public $createdAt;
  25. /**
  26. * @var integer UNIX timestamp representing the rule updating time
  27. */
  28. public $updatedAt;
  29. /**
  30. * Executes the rule.
  31. *
  32. * @param string|integer $user the user ID. This should be either an integer or a string representing
  33. * the unique identifier of a user. See [[\yii\web\User::id]].
  34. * @param Item $item the role or permission that this rule is associated with
  35. * @param array $params parameters passed to [[ManagerInterface::checkAccess()]].
  36. * @return boolean a value indicating whether the rule permits the auth item it is associated with.
  37. */
  38. abstract public function execute($user, $item, $params);
  39. }