Skip to content
Permalink
Browse files

on `cake acl delete <>` delete all matching records. Makes more sense…

… than deleting one of possibly many.
  • Loading branch information...
sam-at-github committed Mar 29, 2014
1 parent 77db212 commit a3fe7cd245b334931aa6f34ccf1fd24626b09aa7
Showing with 12 additions and 5 deletions.
  1. +12 −5 lib/Cake/Console/Command/AclShell.php
@@ -143,20 +143,27 @@ public function create() {
}
/**
* Delete an ARO/ACO node.
* Delete an ARO/ACO node. Note there may be (as a result of poor configuration)
* multiple records with the same logical identifier. All are deleted.
*
* @return void
*/
public function delete() {
extract($this->_dataVars());
$identifier = $this->parseIdentifier($this->args[1]);
$nodeId = $this->_getNodeId($class, $identifier);
if(is_string($identifier)) {
$identifier = ['alias' => $identifier];
}
if (!$this->Acl->{$class}->delete($nodeId)) {
$this->error(__d('cake_console', 'Node Not Deleted') . __d('cake_console', 'There was an error deleting the %s. Check that the node exists.', $class) . "\n");
if($this->Acl->{$class}->find('all')) {
if (!$this->Acl->{$class}->deleteAll($identifier)) {
$this->error(__d('cake_console', 'Node Not Deleted. ') . __d('cake_console', 'There was an error deleting the %s.', $class) . "\n");
}
$this->out(__d('cake_console', '<success>%s deleted.</success>', $class), 2);
} else {
$this->error(__d('cake_console', 'Node Not Deleted. ') . __d('cake_console', 'There was an error deleting the %s. Node does not exist.', $class) . "\n");
}
$this->out(__d('cake_console', '<success>%s deleted.</success>', $class), 2);
}
/**

0 comments on commit a3fe7cd

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.