1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,129 +0,0 @@ |
1 |
-<?php |
|
2 |
- |
|
3 |
-namespace Illuminate\Contracts\Auth\Access; |
|
4 |
- |
|
5 |
-interface Gate |
|
6 |
-{ |
|
7 |
- /** |
|
8 |
- * Determine if a given ability has been defined. |
|
9 |
- * |
|
10 |
- * @param string $ability |
|
11 |
- * @return bool |
|
12 |
- */ |
|
13 |
- public function has($ability); |
|
14 |
- |
|
15 |
- /** |
|
16 |
- * Define a new ability. |
|
17 |
- * |
|
18 |
- * @param string $ability |
|
19 |
- * @param callable|string $callback |
|
20 |
- * @return $this |
|
21 |
- */ |
|
22 |
- public function define($ability, $callback); |
|
23 |
- |
|
24 |
- /** |
|
25 |
- * Define a policy class for a given class type. |
|
26 |
- * |
|
27 |
- * @param string $class |
|
28 |
- * @param string $policy |
|
29 |
- * @return $this |
|
30 |
- */ |
|
31 |
- public function policy($class, $policy); |
|
32 |
- |
|
33 |
- /** |
|
34 |
- * Register a callback to run before all Gate checks. |
|
35 |
- * |
|
36 |
- * @param callable $callback |
|
37 |
- * @return $this |
|
38 |
- */ |
|
39 |
- public function before(callable $callback); |
|
40 |
- |
|
41 |
- /** |
|
42 |
- * Register a callback to run after all Gate checks. |
|
43 |
- * |
|
44 |
- * @param callable $callback |
|
45 |
- * @return $this |
|
46 |
- */ |
|
47 |
- public function after(callable $callback); |
|
48 |
- |
|
49 |
- /** |
|
50 |
- * Determine if the given ability should be granted for the current user. |
|
51 |
- * |
|
52 |
- * @param string $ability |
|
53 |
- * @param array|mixed $arguments |
|
54 |
- * @return bool |
|
55 |
- */ |
|
56 |
- public function allows($ability, $arguments = []); |
|
57 |
- |
|
58 |
- /** |
|
59 |
- * Determine if the given ability should be denied for the current user. |
|
60 |
- * |
|
61 |
- * @param string $ability |
|
62 |
- * @param array|mixed $arguments |
|
63 |
- * @return bool |
|
64 |
- */ |
|
65 |
- public function denies($ability, $arguments = []); |
|
66 |
- |
|
67 |
- /** |
|
68 |
- * Determine if all of the given abilities should be granted for the current user. |
|
69 |
- * |
|
70 |
- * @param iterable|string $abilities |
|
71 |
- * @param array|mixed $arguments |
|
72 |
- * @return bool |
|
73 |
- */ |
|
74 |
- public function check($abilities, $arguments = []); |
|
75 |
- |
|
76 |
- /** |
|
77 |
- * Determine if any one of the given abilities should be granted for the current user. |
|
78 |
- * |
|
79 |
- * @param iterable|string $abilities |
|
80 |
- * @param array|mixed $arguments |
|
81 |
- * @return bool |
|
82 |
- */ |
|
83 |
- public function any($abilities, $arguments = []); |
|
84 |
- |
|
85 |
- /** |
|
86 |
- * Determine if the given ability should be granted for the current user. |
|
87 |
- * |
|
88 |
- * @param string $ability |
|
89 |
- * @param array|mixed $arguments |
|
90 |
- * @return \Illuminate\Auth\Access\Response |
|
91 |
- * |
|
92 |
- * @throws \Illuminate\Auth\Access\AuthorizationException |
|
93 |
- */ |
|
94 |
- public function authorize($ability, $arguments = []); |
|
95 |
- |
|
96 |
- /** |
|
97 |
- * Get the raw result from the authorization callback. |
|
98 |
- * |
|
99 |
- * @param string $ability |
|
100 |
- * @param array|mixed $arguments |
|
101 |
- * @return mixed |
|
102 |
- */ |
|
103 |
- public function raw($ability, $arguments = []); |
|
104 |
- |
|
105 |
- /** |
|
106 |
- * Get a policy instance for a given class. |
|
107 |
- * |
|
108 |
- * @param object|string $class |
|
109 |
- * @return mixed |
|
110 |
- * |
|
111 |
- * @throws \InvalidArgumentException |
|
112 |
- */ |
|
113 |
- public function getPolicyFor($class); |
|
114 |
- |
|
115 |
- /** |
|
116 |
- * Get a guard instance for the given user. |
|
117 |
- * |
|
118 |
- * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user |
|
119 |
- * @return static |
|
120 |
- */ |
|
121 |
- public function forUser($user); |
|
122 |
- |
|
123 |
- /** |
|
124 |
- * Get all of the defined abilities. |
|
125 |
- * |
|
126 |
- * @return array |
|
127 |
- */ |
|
128 |
- public function abilities(); |
|
129 |
-} |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,129 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+namespace Illuminate\Contracts\Auth\Access; |
|
4 |
+ |
|
5 |
+interface Gate |
|
6 |
+{ |
|
7 |
+ /** |
|
8 |
+ * Determine if a given ability has been defined. |
|
9 |
+ * |
|
10 |
+ * @param string $ability |
|
11 |
+ * @return bool |
|
12 |
+ */ |
|
13 |
+ public function has($ability); |
|
14 |
+ |
|
15 |
+ /** |
|
16 |
+ * Define a new ability. |
|
17 |
+ * |
|
18 |
+ * @param string $ability |
|
19 |
+ * @param callable|string $callback |
|
20 |
+ * @return $this |
|
21 |
+ */ |
|
22 |
+ public function define($ability, $callback); |
|
23 |
+ |
|
24 |
+ /** |
|
25 |
+ * Define a policy class for a given class type. |
|
26 |
+ * |
|
27 |
+ * @param string $class |
|
28 |
+ * @param string $policy |
|
29 |
+ * @return $this |
|
30 |
+ */ |
|
31 |
+ public function policy($class, $policy); |
|
32 |
+ |
|
33 |
+ /** |
|
34 |
+ * Register a callback to run before all Gate checks. |
|
35 |
+ * |
|
36 |
+ * @param callable $callback |
|
37 |
+ * @return $this |
|
38 |
+ */ |
|
39 |
+ public function before(callable $callback); |
|
40 |
+ |
|
41 |
+ /** |
|
42 |
+ * Register a callback to run after all Gate checks. |
|
43 |
+ * |
|
44 |
+ * @param callable $callback |
|
45 |
+ * @return $this |
|
46 |
+ */ |
|
47 |
+ public function after(callable $callback); |
|
48 |
+ |
|
49 |
+ /** |
|
50 |
+ * Determine if the given ability should be granted for the current user. |
|
51 |
+ * |
|
52 |
+ * @param string $ability |
|
53 |
+ * @param array|mixed $arguments |
|
54 |
+ * @return bool |
|
55 |
+ */ |
|
56 |
+ public function allows($ability, $arguments = []); |
|
57 |
+ |
|
58 |
+ /** |
|
59 |
+ * Determine if the given ability should be denied for the current user. |
|
60 |
+ * |
|
61 |
+ * @param string $ability |
|
62 |
+ * @param array|mixed $arguments |
|
63 |
+ * @return bool |
|
64 |
+ */ |
|
65 |
+ public function denies($ability, $arguments = []); |
|
66 |
+ |
|
67 |
+ /** |
|
68 |
+ * Determine if all of the given abilities should be granted for the current user. |
|
69 |
+ * |
|
70 |
+ * @param iterable|string $abilities |
|
71 |
+ * @param array|mixed $arguments |
|
72 |
+ * @return bool |
|
73 |
+ */ |
|
74 |
+ public function check($abilities, $arguments = []); |
|
75 |
+ |
|
76 |
+ /** |
|
77 |
+ * Determine if any one of the given abilities should be granted for the current user. |
|
78 |
+ * |
|
79 |
+ * @param iterable|string $abilities |
|
80 |
+ * @param array|mixed $arguments |
|
81 |
+ * @return bool |
|
82 |
+ */ |
|
83 |
+ public function any($abilities, $arguments = []); |
|
84 |
+ |
|
85 |
+ /** |
|
86 |
+ * Determine if the given ability should be granted for the current user. |
|
87 |
+ * |
|
88 |
+ * @param string $ability |
|
89 |
+ * @param array|mixed $arguments |
|
90 |
+ * @return \Illuminate\Auth\Access\Response |
|
91 |
+ * |
|
92 |
+ * @throws \Illuminate\Auth\Access\AuthorizationException |
|
93 |
+ */ |
|
94 |
+ public function authorize($ability, $arguments = []); |
|
95 |
+ |
|
96 |
+ /** |
|
97 |
+ * Get the raw result from the authorization callback. |
|
98 |
+ * |
|
99 |
+ * @param string $ability |
|
100 |
+ * @param array|mixed $arguments |
|
101 |
+ * @return mixed |
|
102 |
+ */ |
|
103 |
+ public function raw($ability, $arguments = []); |
|
104 |
+ |
|
105 |
+ /** |
|
106 |
+ * Get a policy instance for a given class. |
|
107 |
+ * |
|
108 |
+ * @param object|string $class |
|
109 |
+ * @return mixed |
|
110 |
+ * |
|
111 |
+ * @throws \InvalidArgumentException |
|
112 |
+ */ |
|
113 |
+ public function getPolicyFor($class); |
|
114 |
+ |
|
115 |
+ /** |
|
116 |
+ * Get a guard instance for the given user. |
|
117 |
+ * |
|
118 |
+ * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user |
|
119 |
+ * @return static |
|
120 |
+ */ |
|
121 |
+ public function forUser($user); |
|
122 |
+ |
|
123 |
+ /** |
|
124 |
+ * Get all of the defined abilities. |
|
125 |
+ * |
|
126 |
+ * @return array |
|
127 |
+ */ |
|
128 |
+ public function abilities(); |
|
129 |
+} |