Skip to content

Ability to change wildcard permission dot (.) to colon (:) #2110

Answered by erikn69
doraemonxxx asked this question in Q&A
Discussion options

You must be logged in to vote

you could overwrite hasWildcardPermission with your custom WildcardPermission class

protected function hasWildcardPermission($permission, $guardName = null): bool
{
$guardName = $guardName ?? $this->getDefaultGuardName();
if (is_int($permission)) {
$permission = $this->getPermissionClass()->findById($permission, $guardName);
}
if ($permission instanceof Permission) {
$permission = $permission->name;
}
if (! is_string($permission)) {
throw WildcardPermissionInvalidArgument::create();
}
foreach ($this->getAllPermissions() as $

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@doraemonxxx
Comment options

@erikn69
Comment options

@doraemonxxx
Comment options

@erikn69
Comment options

Answer selected by doraemonxxx
Comment options

You must be logged in to vote
1 reply
@drbyte
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants