문제

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.

도움이 되었습니까?

해결책 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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top