PHP Class Acl\Shell\AclShell

Inheritance: extends Cake\Console\Shell
Show file Open project: cakephp/acl

Public Properties

Property Type Description
$Acl Acl\Controller\Component\AclComponent Contains instance of AclComponent
$args array Contains arguments parsed from the command line.
$connection string Contains database source to use
$tasks array Contains tasks to load and instantiate

Public Methods

Method Description
check ( ) : void Check permission for a given ARO to a given ACO.
create ( ) : void Creates an ARO/ACO node
delete ( ) : void Delete an ARO/ACO node.
deny ( ) : void Deny access for an ARO to an ACO.
getOptionParser ( ) : ConsoleOptionParser Gets the option parser instance and configures it.
getPath ( ) : void Get path to specified ARO/ACO node.
grant ( ) : void Grant permission for a given ARO to a given ACO.
inherit ( ) : void Set an ARO to inherit permission to an ACO.
main ( ) : void Override main() for help message hook
nodeExists ( ) : boolean Checks that given node exists
parseIdentifier ( string $identifier ) : mixed Parse an identifier into Model.foreignKey or an alias.
setParent ( ) : void Set parent for an ARO/ACO node.
startup ( ) : void Override startup of the Shell
view ( ) : void Show a specific ARO/ACO node.

Protected Methods

Method Description
_dataVars ( string $type = null ) : array Build data parameters based on node type
_getNodeId ( string $class, string | array $identifier ) : integer | null Get the node for a given identifier. $identifier can either be a string alias or an array of properties to use in AcoNode::node()
_getParams ( ) : array get params for standard Acl methods
_outputNode ( string $class, array $node, integer $indent ) : void Outputs a single node, Either using the alias or Model.key

Method Details

_dataVars() protected method

Build data parameters based on node type
protected _dataVars ( string $type = null ) : array
$type string Node type (ARO/ACO)
return array Variables

_getNodeId() protected method

Get the node for a given identifier. $identifier can either be a string alias or an array of properties to use in AcoNode::node()
protected _getNodeId ( string $class, string | array $identifier ) : integer | null
$class string Class type you want (Aro/Aco)
$identifier string | array A mixed identifier for finding the node.
return integer | null Integer of NodeId. Will trigger an error if nothing is found.

_getParams() protected method

get params for standard Acl methods
protected _getParams ( ) : array
return array aro, aco, action

_outputNode() protected method

Outputs a single node, Either using the alias or Model.key
protected _outputNode ( string $class, array $node, integer $indent ) : void
$class string Class name that is being used.
$node array Array of node information.
$indent integer indent level.
return void

check() public method

Check permission for a given ARO to a given ACO.
public check ( ) : void
return void

create() public method

Creates an ARO/ACO node
public create ( ) : void
return void

delete() public method

Delete an ARO/ACO node.
public delete ( ) : void
return void

deny() public method

Deny access for an ARO to an ACO.
public deny ( ) : void
return void

getOptionParser() public method

Gets the option parser instance and configures it.
public getOptionParser ( ) : ConsoleOptionParser
return ConsoleOptionParser

getPath() public method

Get path to specified ARO/ACO node.
public getPath ( ) : void
return void

grant() public method

Grant permission for a given ARO to a given ACO.
public grant ( ) : void
return void

inherit() public method

Set an ARO to inherit permission to an ACO.
public inherit ( ) : void
return void

main() public method

Override main() for help message hook
public main ( ) : void
return void

nodeExists() public method

Checks that given node exists
public nodeExists ( ) : boolean
return boolean Success

parseIdentifier() public method

Takes an identifier determines its type and returns the result as used by other methods.
public parseIdentifier ( string $identifier ) : mixed
$identifier string Identifier to parse
return mixed a string for aliases, and an array for model.foreignKey

setParent() public method

Set parent for an ARO/ACO node.
public setParent ( ) : void
return void

startup() public method

Override startup of the Shell
public startup ( ) : void
return void

view() public method

Show a specific ARO/ACO node.
public view ( ) : void
return void

Property Details

$Acl public property

Contains instance of AclComponent
public AclComponent,Acl\Controller\Component $Acl
return Acl\Controller\Component\AclComponent

$args public property

Contains arguments parsed from the command line.
public array $args
return array

$connection public property

Contains database source to use
public string $connection
return string

$tasks public property

Contains tasks to load and instantiate
public array $tasks
return array