SDK
SDK Golang v1.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 #

Copied to clipboard!
func (a *Auth) GetMyRights(options types.QueryOptions) ([]*types.UserRights, error)
Arguments Type Description Required
options
QueryOptions
QueryOptions object containing query options yes

Options #

Additional query options

Property Type Description Default
Queuable
bool
Make this request queuable or not true

Return #

A pointer to an array of UserRight object containing:

Property Type Description
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|denied|conditional)

and an error or nil

Usage #

Copied to clipboard!
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")
}