Filter permission must have a matching alias defined #600
Answered
by
datamweb
bedrijfsportaal
asked this question in
Q&A
|
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.. |
Answered by
datamweb
Jan 15, 2023
Replies: 2 comments 14 replies
|
Hello, please run the following command first. composer require codeigniter4/shield:dev-developThere is no need to: public $aliases = [
'permission' => \CodeIgniter\Shield\Filters\PermissionFilter::class,
];
just used : public $filters = [
'permission:users.manage' => [
'before' => ['users/profile']
]
]; |
10 replies
|
@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. |
4 replies
Answer selected by
bedrijfsportaal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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