Is overwriting PermissionFilter possible? #763
Answered
by
kenjis
yassinedoghri
asked this question in
Q&A
-
Is it possible to overwrite the I see it's defined in Apparently Shield's Registrar gets loaded last, thus overwriting anything set in the Thank you for this great library by the way! And thanks in advance for any help. |
Beta Was this translation helpful? Give feedback.
Answered by
kenjis
Jul 5, 2023
Replies: 1 comment 1 reply
-
Registrar is a feature to add or overwrite
--- a/app/Config/Filters.php
+++ b/app/Config/Filters.php
@@ -61,4 +61,11 @@ class Filters extends BaseConfig
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
*/
public array $filters = [];
+
+ public function __construct()
+ {
+ parent::__construct(); // Registrar works in this constructor.
+
+ $this->aliases['permission'] = 'App\Filters\PermissionFilter';
+ }
}
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
yassinedoghri
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Registrar is a feature to add or overwrite
app/Config/*
settings.There is no way to disable a specific Registrar.
But if you disable it, you need to add all config items that all packag…