SDK
SDK PHP v3.x
1

# 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])

Arguments Type Description
id string Unique role identifier to delete
options JSON Object Optional parameters
callback function (Optional) Callback handling the response

# Options

Option Type Description Default
queuable boolean Make this request queuable or not true
refresh string If 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

Copied to clipboard!
<?php
use \Kuzzle\Kuzzle;
$roleId = 'myRole';
$kuzzle = new Kuzzle('localhost');
try {
  $kuzzle->security()->deleteRole($roleId);
}
catch (ErrorException $e) {
}

Callback response

Copied to clipboard!
"deleted role identifier"