8000 Add GHRepository#hasPermission() by gsmet · Pull Request #1433 · hub4j/github-api · GitHub
[go: up one dir, main page]

Skip to content

Add GHRepository#hasPermission() #1433

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

Merged
merged 1 commit into from
Apr 19, 2022
Merged

Conversation

gsmet
Copy link
Contributor
@gsmet gsmet commented Apr 18, 2022

@bitwiseman this is a proposal to add a GHRepository#hasPermission(user, permission) method.

The rationale of it is that most often than not you want to check that someone has at least a given level and not a specific permission.
The current API makes it a bit cumbersome to do it.

The added test explains it all.

@codecov
Copy link
codecov bot commented Apr 18, 2022

Codecov Report

Merging #1433 (830eaa3) into main (2cab124) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #1433      +/-   ##
============================================
+ Coverage     78.62%   78.65%   +0.02%     
- Complexity     2090     2097       +7     
============================================
  Files           201      201              
  Lines          6381     6389       +8     
  Branches        357      359       +2     
============================================
+ Hits           5017     5025       +8     
  Misses         1157     1157              
  Partials        207      207              
Impacted Files Coverage Δ
...main/java/org/kohsuke/github/GHPermissionType.java 100.00% <100.00%> (ø)
src/main/java/org/kohsuke/github/GHRepository.java 68.34% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2cab124...830eaa3. Read the comment docs.

@gsmet
Copy link
Contributor Author
gsmet commented Apr 19, 2022

BTW, if you can include it in 1.304, that would be awesome!

@bitwiseman bitwiseman merged commit 18af515 into hub4j:main Apr 19, 2022
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
0