[JENKINS-36240] Added GHRepository.getPermission(String)#324
Conversation
|
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
| * @param user a {@link GHUser#getLogin} | ||
| * @throws FileNotFoundException under some conditions (e.g., private repo you can see but are not an admin of); treat as unknown | ||
| * @throws HttpException with a 403 under other conditions (e.g., public repo you have no special rights to); treat as unknown | ||
| */ |
There was a problem hiding this comment.
What if we just have this method return an enum of admin/read/write/none?
There was a problem hiding this comment.
And what if the user parameter is GHUser and not `String'?
There was a problem hiding this comment.
have this method return an enum
No problem for me, though we would still need the GHPermission class internally. The current return value seemed more consistent with the overall API design of this component.
what if the user parameter is
GHUser
Does not work for the intended use case. We do not have a GHUser object at that point—just the name. To get a GHUser would require another network call.
JENKINS-36240
Using a new API (currently still in preview) that fixes a longstanding issue.
@reviewbybees