Githawk: Manage not available when part of organisation

Created on 17 Nov 2017  路  7Comments  路  Source: GitHawkApp/GitHawk

I鈥檓 a member of MessageKit org but can鈥檛 manage any of the issues/prs even though I should be able to!


Bug Report Dump (Auto-generated)

Version 1.13.0 (1190)
Device: iPhone 6s Plus (iOS 11.2)
TestFlight: true

馃悰 bug

All 7 comments

@rnystrom

https://github.com/rnystrom/GitHawk/blob/710dae03883a56fcf2cf277cf0579602e4fa0d78/Classes/Issues/GithubClient%2BIssues.swift#L282-L300

Looks like the current API we use is very much just for collaborators

Maybe we should look to refactor that a tiny bit to use this endpoint:

https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level
GET /repos/:owner/:repo/collaborators/:username/permission

This will give us the users permission level out of admin, read, write or none. Where write (I assume) is labels/milestones but covering cases like teams/collab/owner/orgs/etc

@Sherlouk did you test out that API to check your permissions on that repo? So you should have write permissions? I just want to make sure that returns the proper permissions before changing things.

I just tried to check your permissions and got a 403 forbidden

https://api.github.com/repos/messagekit/messagekit/collaborators/sherlouk/permission

{
    "message": "Must have push access to view collaborator permission.",
    "documentation_url": "https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level"
}

Do you have push access to that repo?

What about using the team API?

https://developer.github.com/v3/orgs/teams/#get-team-membership

@Sherlouk can you try accessing your membership for that org?

https://api.github.com/teams/30243544/memberships/sherlouk

@rnystrom

https://api.github.com/repos/messagekit/messagekit/collaborators/sherlouk/permission?access_token=revoked

{
  "permission": "write",
  "user": {
    "login": "Sherlouk",
    ...
    "type": "User",
    "site_admin": false
  }
}

https://api.github.com/teams/30243544/memberships/sherlouk
Just giving me a Not Found error

You shouldn't be able to view my permissions without my access token (I'd be frankly worried if you could!)

FWIW I get the same response when doing IGListKit as well, which adds collaborators a bit differently. So I think this is the right endpoint!

Great!! I鈥檒l update today and send out a new beta.

Sent with GitHawk

Brill!

I've confirmed it on MessageKit (Part of the Org), IGListKit (Collab within an Org), GitHawk (Collab) which are all "write" as well as one of my repos where it's "admin". Both of these need access to manage :)

Looking forward to it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rnystrom picture rnystrom  路  3Comments

rnystrom picture rnystrom  路  3Comments

BasThomas picture BasThomas  路  3Comments

BasThomas picture BasThomas  路  3Comments

Iron-Ham picture Iron-Ham  路  3Comments