3 namespace Illuminate\Contracts\Auth\Access
;
8 * Determine if a given ability has been defined.
10 * @param string $ability
13 public function has($ability);
16 * Define a new ability.
18 * @param string $ability
19 * @param callable|string $callback
22 public function define($ability, $callback);
25 * Define a policy class for a given class type.
27 * @param string $class
28 * @param string $policy
31 public function policy($class, $policy);
34 * Register a callback to run before all Gate checks.
36 * @param callable $callback
39 public function before(callable
$callback);
42 * Register a callback to run after all Gate checks.
44 * @param callable $callback
47 public function after(callable
$callback);
50 * Determine if the given ability should be granted for the current user.
52 * @param string $ability
53 * @param array|mixed $arguments
56 public function allows($ability, $arguments = []);
59 * Determine if the given ability should be denied for the current user.
61 * @param string $ability
62 * @param array|mixed $arguments
65 public function denies($ability, $arguments = []);
68 * Determine if all of the given abilities should be granted for the current user.
70 * @param iterable|string $abilities
71 * @param array|mixed $arguments
74 public function check($abilities, $arguments = []);
77 * Determine if any one of the given abilities should be granted for the current user.
79 * @param iterable|string $abilities
80 * @param array|mixed $arguments
83 public function any($abilities, $arguments = []);
86 * Determine if the given ability should be granted for the current user.
88 * @param string $ability
89 * @param array|mixed $arguments
90 * @return \Illuminate\Auth\Access\Response
92 * @throws \Illuminate\Auth\Access\AuthorizationException
94 public function authorize($ability, $arguments = []);
97 * Get a policy instance for a given class.
99 * @param object|string $class
102 * @throws \InvalidArgumentException
104 public function getPolicyFor($class);
107 * Get a guard instance for the given user.
109 * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user
112 public function forUser($user);
115 * Get all of the defined abilities.
119 public function abilities();