API /admin/users/{username} missing parameter (#4775)

This commit is contained in:
EnricoFerro 2018-08-24 01:59:47 +02:00 committed by techknowlogick
parent 127f477056
commit 912953e82a
5 changed files with 337 additions and 20 deletions

View file

@ -51,6 +51,8 @@ type EditUserOption struct {
AllowGitHook *bool `json:"allow_git_hook"`
AllowImportLocal *bool `json:"allow_import_local"`
MaxRepoCreation *int `json:"max_repo_creation"`
ProhibitLogin *bool `json:"prohibit_login"`
AllowCreateOrganization *bool `json:"allow_create_organization"`
}
// AdminEditUser modify user informations

View file

@ -42,3 +42,10 @@ func (c *Client) GetUserInfo(user string) (*User, error) {
err := c.getParsedResponse("GET", fmt.Sprintf("/users/%s", user), nil, nil, u)
return u, err
}
// GetMyUserInfo get user info of current user
func (c *Client) GetMyUserInfo() (*User, error) {
u := new(User)
err := c.getParsedResponse("GET", "/user", nil, nil, u)
return u, err
}