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.

setPolicies #

Replaces the roles associated with this security profile.


setPolicies(Array<String> policyIDs) #

ArgumentsTypeDescription
policyIDsarray of stringsPolicy IDs to add

setPolicies(Array<JSONObject> policyDefinitions) #

ArgumentsTypeDescription
policyDefinitionsarray of JSON objectsPolicy definitions to add

Return Value #

Returns the Profile object.

Updating a profile will have no impact until the save method is called

Usage #

// Binding role IDs to a profile
profile.setPolicies(new String[]{"role1 ID", "role2 ID", "role3 ID"});
// Binding policies definition to a profile
profile.setPolicies(new JSONObject[]{
  new JSONObject().put('roleId', 'role1 ID'),
  new JSONObject().put('roleId', 'role2 ID'),
  new JSONObject().put('roleId', 'role3 ID')
});