Ability to change wildcard permission dot (.) to colon (:) #2110
-
Hello there, is there any way to change the dot (.) into a colon (:) when using wildcard permission? for example user can access all related admin permission even like even though users don't have these permissions. I would like to use the colon because some requirements in my task. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
after digging some files and code, the delimiter variable can be found in WildcardPermission.php but I don't know how to change |
Beta Was this translation helpful? Give feedback.
-
you could overwrite laravel-permission/src/Traits/HasPermissions.php Lines 163 to 192 in 96466b0 |
Beta Was this translation helpful? Give feedback.
-
You can now replace WildcardPermission class in permission.php config. Add Then do: class WildcardPermission extends \Spatie\Permission\WildcardPermission
{
public const PART_DELIMITER = ':';
} Much cleaner than overriding |
Beta Was this translation helpful? Give feedback.
you could overwrite
hasWildcardPermission
with your customWildcardPermission
classlaravel-permission/src/Traits/HasPermissions.php
Lines 163 to 192 in 96466b0