ApiOpenStudio PHPDoc

UserRoleDelete extends ProcessorEntity

Class UserRoleDelete

Processor class to delete a user role.

Table of Contents

$id  : mixed
Processor ID.
$accountMapper  : AccountMapper
$applicationMapper  : ApplicationMapper
$db  : ADOConnection|null
DB connections.
$details  : array<string|int, mixed>
{@inheritDoc}
$logger  : MonologWrapper
Logger object.
$meta  : array<string|int, mixed>
Metadata for the processor.
$request  : Request
All the request details.
$roleMapper  : RoleMapper
$userMapper  : UserMapper
$userRoleMapper  : UserRoleMapper
__construct()  : mixed
details()  : array<string|int, mixed>
Return details for processor.
process()  : DataContainer
{@inheritDoc}
val()  : mixed|DataContainer
Process a variable into a final result for the processor.
generateParams()  : array<string|int, mixed>
Generate the params array for the sql search.
isDataContainer()  : bool
Validate if a set of data is wrapped in a DataContainer object.
validateCurrentUserAccountPermission()  : mixed
Validate the current user has permissions to create a user/role for an account.
validateCurrentUserApplicationPermission()  : mixed
Validate the current user has permissions to create a user/role for an application.
validateElevatedPermissions()  : mixed
Validate that the current user has sufficient privileges to assign or delete a role.
validateNullAccidAppid()  : mixed
Ensure the correct null values for appid and accid are applied.
validateRoleExists()  : mixed
Validate that a role does not already exist.
validateUserRoleAttributes()  : mixed
Validate that the values for the user role exist.
validateAllowedTypes()  : void
Validate an input for allowed variable types
validateAllowedValues()  : void
Validate an input for allowed values.

Properties

$id

Processor ID.

public mixed $id = ''

Processor ID.

$details

{@inheritDoc}

protected array<string|int, mixed> $details = ['name' => 'User Role delete', 'machineName' => 'user_role_delete', 'description' => 'Delete a role for a user.', 'menu' => 'Admin', 'input' => ['urid' => ['description' => 'The user role ID.', 'cardinality' => [1, 1], 'literalAllowed' => true, 'limitProcessors' => [], 'limitTypes' => ['integer'], 'limitValues' => [], 'default' => null]]]

Details of the processor.

$meta

Metadata for the processor.

protected array<string|int, mixed> $meta

$request

All the request details.

protected Request $request

Request.

Methods

__construct()

public __construct(array<string|int, mixed> &$meta, Request &$request, ADOConnection|null $db, MonologWrapper|null $logger) : mixed
Parameters
$meta : array<string|int, mixed>

Metadata for the processor.

$request : Request

The full request object.

$db : ADOConnection|null

The DB connection object.

$logger : MonologWrapper|null

The logger.

Return values
mixed

details()

Return details for processor.

public details() : array<string|int, mixed>
Return values
array<string|int, mixed>

val()

Process a variable into a final result for the processor.

public val(string $key[, bool|null $rawData = false ]) : mixed|DataContainer

This method can be used to process a value in its meta to return a final result that it can use. If the object is a processor, then it will process that down to a final return value, or if the obj is a simple value, then it will return that. Anything else will return an error object.

Setting $realValue to true will force the value to be the actual value, rather than a potential dataContainer.

Parameters
$key : string

The key for the input variable in the meta.

$rawData : bool|null = false

Return the raw data or a DataContainer.

Tags
throws
ApiException

Invalid key or data.

Return values
mixed|DataContainer

generateParams()

Generate the params array for the sql search.

protected generateParams(string|null $keyword, array<string|int, mixed>|null $keywordCols, string|null $orderBy, string|null $direction) : array<string|int, mixed>
Parameters
$keyword : string|null

Search keyword.

$keywordCols : array<string|int, mixed>|null

Columns to search for the keyword.

$orderBy : string|null

Order by column.

$direction : string|null

Order direction.

Return values
array<string|int, mixed>

isDataContainer()

Validate if a set of data is wrapped in a DataContainer object.

protected isDataContainer(mixed $data) : bool
Parameters
$data : mixed

DataContainer or raw data.

Return values
bool

validateCurrentUserAccountPermission()

Validate the current user has permissions to create a user/role for an account.

protected validateCurrentUserAccountPermission(int $accid) : mixed
Parameters
$accid : int

Application ID to validate the current user against.

Tags
throws
ApiException
Return values
mixed

validateCurrentUserApplicationPermission()

Validate the current user has permissions to create a user/role for an application.

protected validateCurrentUserApplicationPermission(int $appid) : mixed
Parameters
$appid : int

Application ID to validate the current user against.

Tags
throws
ApiException
Return values
mixed

validateElevatedPermissions()

Validate that the current user has sufficient privileges to assign or delete a role.

protected validateElevatedPermissions(UserRole $userRole) : mixed
Parameters
$userRole : UserRole

User role to be created.

Tags
throws
ApiException
Return values
mixed

validateNullAccidAppid()

Ensure the correct null values for appid and accid are applied.

protected validateNullAccidAppid(Role $role, int|null $accid, int|null $appid) : mixed
Parameters
$role : Role

The role for the new user/role.

$accid : int|null

The account ID for the new user/role.

$appid : int|null

The application ID for the new user/role.

Tags
throws
ApiException
Return values
mixed

validateRoleExists()

Validate that a role does not already exist.

protected validateRoleExists(int $uid, int $rid, int|null $accid, int|null $appid) : mixed
Parameters
$uid : int

The user ID for the new user/role.

$rid : int

The role ID for the new user/role.

$accid : int|null

The account ID for the new user/role.

$appid : int|null

The application ID for the new user/role.

Tags
throws
ApiException
Return values
mixed

validateUserRoleAttributes()

Validate that the values for the user role exist.

protected validateUserRoleAttributes(int $uid, int $rid, int|null $accid, int|null $appid) : mixed
Parameters
$uid : int

The user ID for the new user/role.

$rid : int

The role ID for the new user/role.

$accid : int|null

The account ID for the new user/role.

$appid : int|null

The application ID for the new user/role.

Tags
throws
ApiException
Return values
mixed

validateAllowedTypes()

Validate an input for allowed variable types

private validateAllowedTypes(string $type, array<string|int, mixed> $limitTypes, int $min, string $key) : void
Parameters
$type : string

Input value type.

$limitTypes : array<string|int, mixed>

List of limit on variable types.

$min : int

Minimum number of values.

$key : string

The key of the input being validated.

Tags
throws
ApiException

Invalid data type.

Return values
void

validateAllowedValues()

Validate an input for allowed values.

private validateAllowedValues(mixed $val, array<string|int, mixed> $limitValues, int $min, string $key) : void
Parameters
$val : mixed

Input value.

$limitValues : array<string|int, mixed>

List of allowed values.

$min : int

Minimum number of values.

$key : string

The key of the input being validated.

Tags
throws
ApiException

Invalid value.

Return values
void

Search results