prow/github/client.go
func (c *Client) GetUserPermission(org, repo, user string) (string, error) {
	c.log("GetUserPermission", org, repo, user)

	var perm struct {
		Perm string `json:"permission"`
	}
	_, err := c.request(&request{
		method:    http.MethodGet,
		path:      fmt.Sprintf("/repos/%s/%s/collaborators/%s/permission", org, repo, user),
		exitCodes: []int{200},
	}, &perm)
	if err != nil {
		return "", err
	}
	return perm.Perm, nil
}
func (c *Client) GetUserPermission(org, repo, user string) (string, error) {
	c.log("GetUserPermission", org, repo, user)

	var perm struct {
		Perm string `json:"permission"`
	}
	_, err := c.request(&request{
		method:    http.MethodGet,
		path:      fmt.Sprintf("/repos/%s/%s/collaborators/%s/permission", org, repo, user),
		exitCodes: []int{200},
	}, &perm)
	if err != nil {
		return "", err
	}
	return perm.Perm, nil
}
func ( c * Client ) GetUserPermission ( org , repo , user string ) ( string , error ) { c . log ( " " , org , repo , user ) var perm struct { Perm string `json:"permission"` } _ , err := c . request ( & request { method : http . MethodGet , path : fmt . Sprintf ( " " , org , repo , user ) , exitCodes : [ ] int { 200 } , } , & perm ) if err != nil { return " " , err } return perm . Perm , nil }
// GetUserPermission returns the user's permission level for a repo
//
// https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level
GetUserPermission returns the user s permission level for a repo https : // developer . github . com / v3 / repos / collaborators / #review - a - users - permission - level