\CloudMunch\helperRoleHelper

Class RoleHelper This is a helper class for roles.

User can manage roles in cloudmunch using this helper.

Summary

Methods
Properties
Constants
__construct()
isRoleNameUnique()
getExistingRoles()
getRole()
addRole()
updateRole()
checkIfRoleExists()
No public properties found
APPLICATIONS
TIERS
No protected methods found
No protected properties found
N/A
No private methods found
$appContext
$cmDataManager
$logHelper
N/A

Constants

APPLICATIONS

APPLICATIONS

TIERS

TIERS

Properties

$appContext

$appContext : \CloudMunch\helper\CloudMunch\AppContext

Type

\CloudMunch\helper\CloudMunch\AppContext — Reference to AppContext object.

$cmDataManager

$cmDataManager : \CloudMunch\helper\CloudMunch\datamanager\CMDataManager

Type

\CloudMunch\helper\CloudMunch\datamanager\CMDataManager — Reference to CMDataManager object.

$logHelper

$logHelper : \CloudMunch\helper\CloudMunch\loghandling\LogHandler

Type

\CloudMunch\helper\CloudMunch\loghandling\LogHandler — Reference to LogHandler object.

Methods

__construct()

__construct(\CloudMunch\helper\CloudMunch\AppContext  $appContext, \CloudMunch\helper\CloudMunch\loghandling\LogHandler  $logHandler) 

Constructor to initialise Application Context and LogHandler.

Parameters

\CloudMunch\helper\CloudMunch\AppContext $appContext
\CloudMunch\helper\CloudMunch\loghandling\LogHandler $logHandler

isRoleNameUnique()

isRoleNameUnique(string  $existingRoles, string  $roleName) : boolean

Check if given name of the role is unique with existing ones

Parameters

string $existingRoles

: list of existing roles

string $roleName

: name of the role to be verified

Returns

boolean —

true if name is unique

getExistingRoles()

getExistingRoles(  $filterdata = null) : \CloudMunch\helper\json

Get details of all roles based on the filter criteria.

Parameters

$filterdata

Returns

\CloudMunch\helper\json —

object roledetails

getRole()

getRole(String  $roleID,   $filterdata) : \CloudMunch\helper\json

Retrieve role details of the given ID.

Parameters

String $roleID
$filterdata

Returns

\CloudMunch\helper\json —

object roledetails

addRole()

addRole(string  $roleName, array  $roleData = null) : array

Add a new role to application.

Parameters

string $roleName

Name of the role

array $roleData

Array of role properties

Returns

array —

Details of new role added.

updateRole()

updateRole(String  $roleID, \CloudMunch\helper\JsonObject  $roleData = null) 

Updates role with given data.

Parameters

String $roleID
\CloudMunch\helper\JsonObject $roleData

checkIfRoleExists()

checkIfRoleExists(string  $roleID) : boolean

Checks if Role exists in cloudmunch.

Parameters

string $roleID

Returns

boolean