SDK
SDK Golang v3.x
2

GetMyRights #

Returns the rights for the user linked to the JSON Web Token, provided in the query or the Authorization header.

Arguments #

func (a *Auth) GetMyRights(options types.QueryOptions) ([]*types.UserRights, error)
ArgumentsTypeDescriptionRequired
options
QueryOptions
QueryOptions object containing query optionsyes

Options #

Additional query options

PropertyTypeDescriptionDefault
Queuable
bool
Make this request queuable or nottrue

Return #

A pointer to an array of UserRight object containing:

PropertyTypeDescription
Controller
string
Controller on wich the rights are applied
Action
string
Action on wich the rights are applied
Index
string
Index on wich the rights are applied
Collection
string
Collection on wich the rights are applied
Value
string
Rights (`allowed

and an error or nil

Usage #

kuzzle.Auth.Login("local", json.RawMessage("{\"username\":\"foo\",\"password\":\"bar\"}"), nil)
_, err := kuzzle.Auth.GetMyRights(nil)
if err != nil {
  log.Fatal(err)
} else {
  fmt.Println("Success")
}