SDK
SDK Golang v2.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

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")
}