Filter permission must have a matching alias defined #600
-
Hi, I'm writing page permissions for my users, this is defined in The alias and filter public $aliases = [
'permission' => \CodeIgniter\Shield\Filters\PermissionFilter::class,
];
public $filters = [
'permission:users.manage' => [
'before' => ['users/profile']
]
]; Is there something missing or not understand from this point, i'm lost right now.. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
Hello, please run the following command first. composer require codeigniter4/shield:dev-develop There is no need to: public $aliases = [
'permission' => \CodeIgniter\Shield\Filters\PermissionFilter::class,
];
just used : public $filters = [
'permission:users.manage' => [
'before' => ['users/profile']
]
]; |
Beta Was this translation helpful? Give feedback.
-
@kenjis please see here. In documents CI, there is no explanation regarding the use of arguments in method filters. Therefore, it seems, it is not possible to use arguments in this method. According to the Shield docs, it should be updated. |
Beta Was this translation helpful? Give feedback.
@kenjis please see here.
In documents CI, there is no explanation regarding the use of arguments in method filters. Therefore, it seems, it is not possible to use arguments in this method.
According to the Shield docs, it should be updated.
https://github.com/codeigniter4/shield/blob/develop/docs/authorization.md#authorizing-via-filters