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

Add hasAnyRole function to validate multiple roles for a given resource #88

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

luizjr
Copy link
Contributor

@luizjr luizjr commented Mar 25, 2023

In this commit, a new function called hasAnyRole was added to check if a user possesses any of the specified roles for a given resource. This function accepts a resource and an array of roles as input parameters and returns true if the user has at least one of the roles, or false otherwise. The implementation builds on the existing hasRole function, iterating through the array of roles to perform the necessary validation.

In this commit, a new function called hasAnyRole was added to check if a user possesses any of the specified roles for a given resource. This function accepts a resource and an array of roles as input parameters and returns true if the user has at least one of the roles, or false otherwise. The implementation builds on the existing hasRole function, iterating through the array of roles to perform the necessary validation.
@robsontenorio
Copy link
Owner

@luizjr Could you please add some test and provide a minimal docs for README.? Thanks!

@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #88 (b8b3275) into master (ade40e3) will not change coverage.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##              master       #88   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        32        37    +5     
===========================================
  Files              4         4           
  Lines             88        97    +9     
===========================================
+ Hits              88        97    +9     
Impacted Files Coverage Δ
src/KeycloakGuard.php 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@luizjr
Copy link
Contributor Author

luizjr commented Apr 9, 2023

@robsontenorio Do I need to do anything else to unlock this new functionality?

@robsontenorio robsontenorio merged commit ccbc9b7 into robsontenorio:master Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants