SDK
SDK Java 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.

deleteRole #

Delete the provided role.

There is a small delay between the time a role is deleted and it being reflected in the search layer (usually a couple of seconds). That means that a role that was just deleted might still be returned by the searchRoles function.


deleteRole(id, [options], [callback]) #

ArgumentsTypeDescription
idstringUnique role identifier to delete
optionsJSON ObjectOptional parameters
callbackfunction(Optional) Callback handling the response

Options #

OptionTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue
refreshstringIf set to wait_for, Kuzzle will wait the persistence layer to finish indexing (available with Elasticsearch 5.x and above)undefined

Return Value #

Returns the Security object to allow chaining.


Callback Response #

Returns the id of the rold that has been deleted.

Usage #

kuzzle
  .security
  .deleteRole("myrole", new ResponseListener<String>() {
    @Override
    public void onSuccess(String roleName) {
    }
    @Override
    public void onError(JSONObject error) {
    }
  });

Callback response

"deleted role identifier"