public class RoleInheritanceTestUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
ACCESS_NAMES
list with the available access types
|
static String |
ASTERISK_ORG_ID
zero organization id
|
static String |
CLIENT_ID
F&B International Group client id
|
| Constructor and Description |
|---|
RoleInheritanceTestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAccess(String type,
Role role,
String accessName)
Creates a new permission and assigns it to a role
|
static void |
addInheritance(Role role,
Role template,
Long sequenceNumber)
Adds a new inheritance between two roles
|
static Role |
createRole(String name,
String clientId,
String organizationId,
String userLevel,
boolean isManual,
boolean isTemplate)
Creates a new role
|
static void |
deleteRole(Role role)
Deletes a role
|
static String[] |
getAccessInfo(String type,
Role role,
String accessName)
Retrieves the information of a permission assigned to a role
|
static String[] |
getOrderedAccessNames(String type,
Role role)
Retrieves an array with permissions information assigned to a role, ordered by name
|
static void |
removeAccesses(String type,
Role role)
Removes a permission assigned to a role
|
static void |
removeInheritance(Role role,
Role template)
Removes an existing inheritance
|
static void |
updateAccess(String type,
Role role,
String accessName,
boolean editedValue,
boolean isActive)
Updates an existing permission assigned to a role
|
public static final String CLIENT_ID
public static final String ASTERISK_ORG_ID
public static Role createRole(String name, String clientId, String organizationId, String userLevel, boolean isManual, boolean isTemplate)
name - the name of the roleclientId - role client idorganizationId - role organization iduserLevel - user level of the role's organizationisManual - defines if the role is manual (true) or automatic (false)isTemplate - defines if the role is template (true) or not (false)public static void deleteRole(Role role)
role - A Role object which will be deletedpublic static void addInheritance(Role role, Role template, Long sequenceNumber)
role - The role owner of the inheritancetemplate - The template role whose permissions will be inheritedsequenceNumber - Sequence number to assign to the inheritancepublic static void removeInheritance(Role role, Role template)
role - The role owner of the inheritancetemplate - The template role whose permissions are being inheritedpublic static void addAccess(String type, Role role, String accessName)
type - A String which represents the type of the accessrole - The role to assign the permissionaccessName - The name of the particular permission to assignpublic static void removeAccesses(String type, Role role)
type - A String which represents the type of the accessrole - The role owner of the permissionpublic static void updateAccess(String type, Role role, String accessName, boolean editedValue, boolean isActive)
type - A String which represents the type of the accessrole - The role owner of the permissionaccessName - The name of the particular permission to updateeditedValue - The edited value to assign to the permissionisActive - a flag to activate (true) or deactivate (false) the permissionpublic static String[] getAccessInfo(String type, Role role, String accessName)
type - A String which represents the type of the accessrole - The role owner of the permissionaccessName - The name of the particular permission to retrievepublic static String[] getOrderedAccessNames(String type, Role role)
type - A String which represents the type of the accessrole - The role to assign the permission