Add RemoveUser()
This commit is contained in:
13
team.go
13
team.go
@ -43,6 +43,19 @@ func (t Team) AddUser(user, role string) (TeamAPI, error) {
|
|||||||
return r, err
|
return r, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoveUser removes a member from a team
|
||||||
|
func (t Team) RemoveUser(user string) (TeamAPI, error) {
|
||||||
|
m := TeamAPI{
|
||||||
|
Params: &tParams{},
|
||||||
|
}
|
||||||
|
m.Method = "remove-member"
|
||||||
|
m.Params.Options.Team = t.Name
|
||||||
|
m.Params.Options.Username = user
|
||||||
|
|
||||||
|
r, err := teamAPIOut(t.keybase.Path, m)
|
||||||
|
return r, err
|
||||||
|
}
|
||||||
|
|
||||||
// AddReaders adds members to a team by username, and sets their roles to Reader
|
// AddReaders adds members to a team by username, and sets their roles to Reader
|
||||||
func (t Team) AddReaders(users ...string) (TeamAPI, error) {
|
func (t Team) AddReaders(users ...string) (TeamAPI, error) {
|
||||||
m := TeamAPI{
|
m := TeamAPI{
|
||||||
|
|||||||
1
types.go
1
types.go
@ -374,6 +374,7 @@ type tOptions struct {
|
|||||||
Team string `json:"team"`
|
Team string `json:"team"`
|
||||||
Emails []emails `json:"emails"`
|
Emails []emails `json:"emails"`
|
||||||
Usernames []usernames `json:"usernames"`
|
Usernames []usernames `json:"usernames"`
|
||||||
|
Username string `json:"username"`
|
||||||
}
|
}
|
||||||
type tParams struct {
|
type tParams struct {
|
||||||
Options tOptions `json:"options"`
|
Options tOptions `json:"options"`
|
||||||
|
|||||||
Reference in New Issue
Block a user