Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for multiple permissions check for users #791

Merged
merged 7 commits into from
Aug 22, 2023

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
docs/authorization.md Outdated Show resolved Hide resolved
docs/authorization.md Outdated Show resolved Hide resolved
@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
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
28 checks passed
@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