setPolicies

policy = { "roleId": "roleId" };

// Replaces the profile policies set with the given entry.
profile.setPolicies([policy]);
// 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')
});

Replaces the roles policies associated to the profile.


setPolicies(ArraypolicyIDs)

ArgumentsTypeDescription
policyIDsarray of stringsPolicy IDs to add

setPolicies(ArraypolicyDefinitions)

ArgumentsTypeDescription
policyDefinitionsarray of JSON objectsPolicy definitions to add

Return value

Returns the Profile object.