-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 API to query collaborators permission for a repository #18761
Conversation
d0490e8
to
10c0876
Compare
Codecov Report
@@ Coverage Diff @@
## main #18761 +/- ##
=======================================
Coverage ? 47.37%
=======================================
Files ? 952
Lines ? 132516
Branches ? 0
=======================================
Hits ? 62776
Misses ? 62178
Partials ? 7562
Continue to review full report at Codecov.
|
GitHub API endpoint returns the permissions Since this is a design question, I would really be happy to get a input from a author. |
I vote to have an owner permission which should be equal to admin in Github. |
The current solution is to return the serialized form of I'll mention this in the PR description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my comment
This comment was marked as outdated.
This comment was marked as outdated.
|
Ok, I was actually not sure about this, I won't squash next time 👍 |
you can test your tests localy too:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how could i overlooke that 😅 - thats why tests are nice - works localy
🚀 |
…18761) Targeting go-gitea#14936, go-gitea#15332 Adds a collaborator permissions API endpoint according to GitHub API: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user to retrieve a collaborators permissions for a specific repository. ### Checks the repository permissions of a collaborator. `GET` `/repos/{owner}/{repo}/collaborators/{collaborator}/permission` Possible `permission` values are `admin`, `write`, `read`, `owner`, `none`. ```json { "permission": "admin", "role_name": "admin", "user": {} } ``` Where `permission` and `role_name` hold the same `permission` value and `user` is filled with the user API object. Only admins are allowed to use this API endpoint.
* giteaofficial/main: Avoid MoreThanOne Error (go-gitea#19557) [skip ci] Updated licenses and gitignores Simplify loops to copy (go-gitea#19569) Use middleware to open gitRepo (go-gitea#19559) Added X-Mailer header to outgoing emails (go-gitea#19562) fix go-gitea#19545 (go-gitea#19563) [skip ci] Updated translations via Crowdin Respect DefaultUserIsRestricted system default when creating new user (go-gitea#19310) Mute link in diff header (go-gitea#19556) Add API to query collaborators permission for a repository (go-gitea#18761) Permalink files In PR diff (go-gitea#19534) Fix Pull Request comment filename word breaks (go-gitea#19535) Don't error when branch's commit doesn't exist (go-gitea#19547)
…18761) Targeting go-gitea#14936, go-gitea#15332 Adds a collaborator permissions API endpoint according to GitHub API: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user to retrieve a collaborators permissions for a specific repository. `GET` `/repos/{owner}/{repo}/collaborators/{collaborator}/permission` Possible `permission` values are `admin`, `write`, `read`, `owner`, `none`. ```json { "permission": "admin", "role_name": "admin", "user": {} } ``` Where `permission` and `role_name` hold the same `permission` value and `user` is filled with the user API object. Only admins are allowed to use this API endpoint.
Targeting #14936, #15332
Adds a collaborator permissions API endpoint according to GitHub API: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user to retrieve a collaborators permissions for a specific repository.
Checks the repository permissions of a collaborator.
GET
/repos/{owner}/{repo}/collaborators/{collaborator}/permission
Possible
permission
values areadmin
,write
,read
,owner
,none
.Where
permission
androle_name
hold the samepermission
value anduser
is filled with the user API object. Only admins are allowed to use this API endpoint.