class RoleCommands extends DrushCommands implements SiteAliasManagerAwareInterface (View source)

Traits

SiteAliasManagerAwareTrait
ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct()

No description

io()

Override Robo's IO function with our custom style.

LoggerInterface
logger()

Returns a logger object.

printFile(string $file)

Print the contents of a file.

create($machine_name, $human_readable_name = null)

Create a new role.

delete($machine_name)

Delete a new role.

roleAddPerm($machine_name, $permissions)

Grant specified permission(s) to a role.

roleRemovePerm($machine_name, $permissions)

Remove specified permission(s) from a role.

RowsOfFields
roleList($options = ['format' => 'yaml'])

Display a list of all roles defined on the system.

renderPermsCell($key, $cellData, FormatterOptions $options)

No description

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct()

protected io()

Override Robo's IO function with our custom style.

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

create($machine_name, $human_readable_name = null)

Create a new role.

Parameters

$machine_name The symbolic machine name for the role.
$human_readable_name A descriptive name for the role.

delete($machine_name)

Delete a new role.

Parameters

$machine_name The symbolic machine name for the role.

roleAddPerm($machine_name, $permissions)

Grant specified permission(s) to a role.

Parameters

$machine_name The role to modify.
$permissions The list of permission to grant, delimited by commas.

roleRemovePerm($machine_name, $permissions)

Remove specified permission(s) from a role.

Parameters

$machine_name The role to modify.
$permissions The list of permission to grant, delimited by commas.

RowsOfFields roleList($options = ['format' => 'yaml'])

Display a list of all roles defined on the system.

If a role name is provided as an argument, then all of the permissions of that role will be listed. If a permission name is provided as an option, then all of the roles that have been granted that permission will be listed.

Parameters

$options

Return Value

RowsOfFields

renderPermsCell($key, $cellData, FormatterOptions $options)

Parameters

$key
$cellData
FormatterOptions $options