Closed jozefrebjak closed 1 year ago
@jozefrebjak I don't understand what you mean, can you send a simple example of table data and sample code for review.
What do you mean by $group->can('users.admin.access')
? Where in the documentation have we used this?
@jozefrebjak I don't understand what you mean, can you send a simple example of table data and sample code for review.
What do you mean by
$group->can('users.admin.access')
? Where in the documentation have we used this?
@datamweb You can see an example here. I'm building a similar UI interface in my project.
As you can see, there is just a simple check if a group can access a specified permission and there is an issue with groups where we use the wildcard, because it's checking the exact match now. I fixed this behaviour in https://github.com/codeigniter4/shield/pull/649
PHP Version
8.1.14
CodeIgniter4 Version
4.3.2
Shield Version
dev-develop
Which operating systems have you tested for this bug?
macOS
Which server did you use?
cli-server (PHP built-in webserver)
Database
MariaDB 10.2
Did you customize Shield?
No
What happened?
Method in Group entity
can
is always false if group has permissions defined with*
.Steps to Reproduce
For example superadmin:
can
method usepopulatePermissions
method to get permissions.and
$this->permissions
will return array like:So for example if we use
$group->can('users.admin.access')
can
method will returnfalse
.Expected Output
Include in
can
method also permissions with*
specified.Anything else?
No response