Skip to content

Implement list/check/delete-endpoints collaborator #3689

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
Feb 14, 2017

Conversation

bkcsoft
Copy link
Contributor

@bkcsoft bkcsoft commented Sep 23, 2016

Implements List/Check/Delete-endpoints for Repo-Collaborators

Depends on gogs/go-gogs-client#51

New Endpoints

List Collaborators

GET /repos/:owner/:repo/collaborators
Example
$ curl https://try.gogs.io/api/v1/repos/unknwon/gogs/collaborators
Response
Status: 200 OK
Content-Type: application/json
[
    {
        "id": 1,
        "username": "unknwon",
        "full_name": "",
        "email": "[email protected]",
        "avatar_url": "/avatar_url/1",
        "permissions": {
            "admin": true,
            "push": true,
            "pull": true
        }
    }
]

Check if a user is a collaborator

GET /repos/:owner/:repo/collaborators/:collaborator

Example

$ curl https://try.gogs.io/api/v1/repos/unknwon/gogs/collaborators/bkcsoft

Response if user is a collaborator

Status: 204 No Content

Response if user is not a collaborator

Status: 404 Not Found

Remove user as a collaborator

DELETE /repos/:owner/:repo/collaborators/:collaborator

Example

$ curl -X DELETE https://try.gogs.io/api/v1/repos/unknwon/gogs/collaborators/bkcsoft

Response

Status: 204 No Content

@unknwon unknwon added the status: waits for review It is waiting to be reviewed by maintainers label Feb 1, 2017
@bkcsoft
Copy link
Contributor Author

bkcsoft commented Feb 14, 2017

@unknwon Can't restart the travis-build, should go green if it's just restarted :)

@unknwon
Copy link
Member

unknwon commented Feb 14, 2017

I forgot to restart, now restarted. (1.4 should fail because no longer supported)

@unknwon
Copy link
Member

unknwon commented Feb 14, 2017

Thanks!

@unknwon unknwon merged commit b6fc35f into gogs:develop Feb 14, 2017
Martchus pushed a commit to Martchus/gogs that referenced this pull request Aug 27, 2018
* Add database migrations for merge whitelist

* Add merge whitelist settings for protected branches

* Add checks for merge whitelists
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: waits for review It is waiting to be reviewed by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants