Skip to content

Conversation

@sammyskills
Copy link
Contributor

@sammyskills sammyskills commented Aug 16, 2023

Added support for multiple permissions check for users via the Authorizable trait.

With this pull request, instead of writing:

if ($user->can('user.create') || $user->can('user.edit')){
    //
}

we use this:

if ($user->can('user.create', 'user.edit')){
    //
}

@datamweb datamweb added the enhancement New feature or request label Aug 17, 2023
@datamweb datamweb changed the title Add support for multiple permissions check for users. feat: add support for multiple permissions check for users Aug 17, 2023
@sammyskills sammyskills requested a review from datamweb August 17, 2023 23:23
@sammyskills sammyskills requested a review from kenjis August 18, 2023 06:45
@kenjis
Copy link
Member

kenjis commented Aug 21, 2023

The implementation looks good.

@jozefrebjak
Copy link
Contributor

@sammyskills maybe add test also for wildcard case users.*

@sammyskills sammyskills force-pushed the support-multiple-permissions branch from 8ae0f85 to 6d9e5be Compare August 21, 2023 07:52
@sammyskills
Copy link
Contributor Author

@sammyskills maybe add test also for wildcard case users.*

Yes, you are correct @jozefrebjak. I have added that now.

Copy link
Collaborator

@datamweb datamweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
@sammyskills and @jozefrebjak thanks.

@kenjis kenjis merged commit f334a92 into codeigniter4:develop Aug 22, 2023
@kenjis
Copy link
Member

kenjis commented Aug 22, 2023

@sammyskills Thank you!

@sammyskills sammyskills deleted the support-multiple-permissions branch August 22, 2023 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants