Question

I'm making use of jGit for Git related operations. I'm looking for API's there which would let me check if a particular userid has the necessary push permission to that repo. I couldn't find anything related to this. I can see the Repository API class - http://download.eclipse.org/jgit/docs/latest/apidocs/org/eclipse/jgit/lib/Repository.html but that doesn't have anything as well.

One way for this is to actually try to commit/push a new file to the repository and catch exception for the push and check.

But is there any other API which would let me achieve this?

Thanks.

Was it helpful?

Solution 2

SOLVED: This can be achieved using the egit API's https://github.com/eclipse/egit-github/tree/master/org.eclipse.egit.github.core.

Basically the API's gives services like the RepositoryService, OrganizationService etc... using which we can see if a user has the necessary permissions.

OTHER TIPS

Unfortunately, I don't think so. Permissions could be implemented via hook scripts, so the only way to find out is to try. :-(

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top