composer package updates
[openemr.git] / vendor / illuminate / contracts / Auth / Access / Gate.php
blob2021b573e6c106ffe0821f4341627df240aa01bd
1 <?php
3 namespace Illuminate\Contracts\Auth\Access;
5 interface Gate
7 /**
8 * Determine if a given ability has been defined.
10 * @param string $ability
11 * @return bool
13 public function has($ability);
15 /**
16 * Define a new ability.
18 * @param string $ability
19 * @param callable|string $callback
20 * @return $this
22 public function define($ability, $callback);
24 /**
25 * Define a policy class for a given class type.
27 * @param string $class
28 * @param string $policy
29 * @return $this
31 public function policy($class, $policy);
33 /**
34 * Register a callback to run before all Gate checks.
36 * @param callable $callback
37 * @return $this
39 public function before(callable $callback);
41 /**
42 * Register a callback to run after all Gate checks.
44 * @param callable $callback
45 * @return $this
47 public function after(callable $callback);
49 /**
50 * Determine if the given ability should be granted for the current user.
52 * @param string $ability
53 * @param array|mixed $arguments
54 * @return bool
56 public function allows($ability, $arguments = []);
58 /**
59 * Determine if the given ability should be denied for the current user.
61 * @param string $ability
62 * @param array|mixed $arguments
63 * @return bool
65 public function denies($ability, $arguments = []);
67 /**
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
72 * @return bool
74 public function check($abilities, $arguments = []);
76 /**
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
81 * @return bool
83 public function any($abilities, $arguments = []);
85 /**
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 = []);
96 /**
97 * Get a policy instance for a given class.
99 * @param object|string $class
100 * @return mixed
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
110 * @return static
112 public function forUser($user);
115 * Get all of the defined abilities.
117 * @return array
119 public function abilities();