Acl\Shell\AclShell::getOptionParser PHP Method

getOptionParser() public method

Gets the option parser instance and configures it.
public getOptionParser ( ) : ConsoleOptionParser
return ConsoleOptionParser
    public function getOptionParser()
    {
        $parser = parent::getOptionParser();
        $type = ['choices' => ['aro', 'aco'], 'required' => true, 'help' => __d('cake_acl', 'Type of node to create.')];
        $parser->description(__d('cake_acl', 'A console tool for managing the DbAcl'))->addSubcommand('create', ['help' => __d('cake_acl', 'Create a new ACL node'), 'parser' => ['description' => __d('cake_acl', 'Creates a new ACL object <node> under the parent'), 'epilog' => __d('cake_acl', 'You can use `root` as the parent when creating nodes to create top level nodes.'), 'arguments' => ['type' => $type, 'parent' => ['help' => __d('cake_acl', 'The node selector for the parent.'), 'required' => true], 'alias' => ['help' => __d('cake_acl', 'The alias to use for the newly created node.'), 'required' => true]]]])->addSubcommand('delete', ['help' => __d('cake_acl', 'Deletes the ACL object with the given <node> reference'), 'parser' => ['description' => __d('cake_acl', 'Delete an ACL node.'), 'arguments' => ['type' => $type, 'node' => ['help' => __d('cake_acl', 'The node identifier to delete.'), 'required' => true]]]])->addSubcommand('setparent', ['help' => __d('cake_acl', 'Moves the ACL node under a new parent.'), 'parser' => ['description' => __d('cake_acl', 'Moves the ACL object specified by <node> beneath <parent>'), 'arguments' => ['type' => $type, 'node' => ['help' => __d('cake_acl', 'The node to move'), 'required' => true], 'parent' => ['help' => __d('cake_acl', 'The new parent for <node>.'), 'required' => true]]]])->addSubcommand('getpath', ['help' => __d('cake_acl', 'Print out the path to an ACL node.'), 'parser' => ['description' => [__d('cake_acl', "Returns the path to the ACL object specified by <node>."), __d('cake_acl', "This command is useful in determining the inheritance of permissions for a certain object in the tree.")], 'arguments' => ['type' => $type, 'node' => ['help' => __d('cake_acl', 'The node to get the path of'), 'required' => true]]]])->addSubcommand('check', ['help' => __d('cake_acl', 'Check the permissions between an ACO and ARO.'), 'parser' => ['description' => [__d('cake_acl', 'Use this command to check ACL permissions.')], 'arguments' => ['aro' => ['help' => __d('cake_acl', 'ARO to check.'), 'required' => true], 'aco' => ['help' => __d('cake_acl', 'ACO to check.'), 'required' => true], 'action' => ['help' => __d('cake_acl', 'Action to check'), 'default' => 'all']]]])->addSubcommand('grant', ['help' => __d('cake_acl', 'Grant an ARO permissions to an ACO.'), 'parser' => ['description' => [__d('cake_acl', 'Use this command to grant ACL permissions. Once executed, the ARO specified (and its children, if any) will have ALLOW access to the specified ACO action (and the ACO\'s children, if any).')], 'arguments' => ['aro' => ['help' => __d('cake_acl', 'ARO to grant permission to.'), 'required' => true], 'aco' => ['help' => __d('cake_acl', 'ACO to grant access to.'), 'required' => true], 'action' => ['help' => __d('cake_acl', 'Action to grant'), 'default' => 'all']]]])->addSubcommand('deny', ['help' => __d('cake_acl', 'Deny an ARO permissions to an ACO.'), 'parser' => ['description' => [__d('cake_acl', 'Use this command to deny ACL permissions. Once executed, the ARO specified (and its children, if any) will have DENY access to the specified ACO action (and the ACO\'s children, if any).')], 'arguments' => ['aro' => ['help' => __d('cake_acl', 'ARO to deny.'), 'required' => true], 'aco' => ['help' => __d('cake_acl', 'ACO to deny.'), 'required' => true], 'action' => ['help' => __d('cake_acl', 'Action to deny'), 'default' => 'all']]]])->addSubcommand('inherit', ['help' => __d('cake_acl', 'Inherit an ARO\'s parent permissions.'), 'parser' => ['description' => [__d('cake_acl', "Use this command to force a child ARO object to inherit its permissions settings from its parent.")], 'arguments' => ['aro' => ['help' => __d('cake_acl', 'ARO to have permissions inherit.'), 'required' => true], 'aco' => ['help' => __d('cake_acl', 'ACO to inherit permissions on.'), 'required' => true], 'action' => ['help' => __d('cake_acl', 'Action to inherit'), 'default' => 'all']]]])->addSubcommand('view', ['help' => __d('cake_acl', 'View a tree or a single node\'s subtree.'), 'parser' => ['description' => [__d('cake_acl', "The view command will return the ARO or ACO tree."), __d('cake_acl', "The optional node parameter allows you to return"), __d('cake_acl', "only a portion of the requested tree.")], 'arguments' => ['type' => $type, 'node' => ['help' => __d('cake_acl', 'The optional node to view the subtree of.')]]]])->epilog(['Node and parent arguments can be in one of the following formats:', '', ' - <model>.<id> - The node will be bound to a specific record of the given model.', '', ' - <alias> - The node will be given a string alias (or path, in the case of <parent>)', "   i.e. 'John'. When used with <parent>, this takes the form of an alias path,", "   i.e. <group>/<subgroup>/<parent>.", '', "To add a node at the root level, enter 'root' or '/' as the <parent> parameter."]);
        return $parser;
    }