1 | <?php |
||
22 | class AuthorizedController extends AuthenticatedController |
||
23 | { |
||
24 | use AuthorizesRequests; |
||
25 | |||
26 | /** |
||
27 | * Resource Ability Map. |
||
28 | * |
||
29 | * Array of resource ability map. |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $resourceAbilityMap = []; |
||
34 | |||
35 | /** |
||
36 | * Resource action whitelist. |
||
37 | * |
||
38 | * Array of resource actions to skip mapping to abilities automatically. |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $resourceActionWhitelist = []; |
||
|
|||
43 | |||
44 | /** |
||
45 | * Create a new manage persistence controller instance. |
||
46 | * |
||
47 | * @throws \Rinvex\Fort\Exceptions\AuthorizationException |
||
48 | */ |
||
49 | public function __construct() |
||
61 | |||
62 | /** |
||
63 | * Authorize a resource action based on the incoming request. |
||
64 | * |
||
65 | * @param string $resource |
||
66 | * @param string|null $parameter |
||
67 | * @param array $options |
||
68 | * @param \Illuminate\Http\Request|null $request |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | public function authorizeResource($resource, $parameter = null, array $options = [], $request = null) |
||
87 | |||
88 | /** |
||
89 | * Map resource actions to resource abilities. |
||
90 | * |
||
91 | * @return array |
||
92 | */ |
||
93 | protected function mapResourceAbilities() |
||
115 | |||
116 | /** |
||
117 | * Get the map of resource methods to ability names. |
||
118 | * |
||
119 | * @return array |
||
120 | */ |
||
121 | protected function resourceAbilityMap() |
||
131 | } |
||
132 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.