Browse Source

Merge branch 'master' into 2.5

mark_story 12 years ago
parent
commit
f9b45f1b60

+ 2 - 6
lib/Cake/Cache/Cache.php

@@ -277,9 +277,7 @@ class Cache {
 	}
 
 /**
- * Write data for key into cache. Will automatically use the currently
- * active cache configuration. To set the currently active configuration use
- * Cache::config()
+ * Write data for key into a cache engine.
  *
  * ### Usage:
  *
@@ -328,9 +326,7 @@ class Cache {
 	}
 
 /**
- * Read a key from the cache. Will automatically use the currently
- * active cache configuration. To set the currently active configuration use
- * Cache::config()
+ * Read a key from a cache config.
  *
  * ### Usage:
  *

+ 12 - 5
lib/Cake/Console/Command/AclShell.php

@@ -143,7 +143,8 @@ class AclShell extends AppShell {
 	}
 
 /**
- * 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
  */
@@ -151,12 +152,18 @@ class AclShell extends AppShell {
 		extract($this->_dataVars());
 
 		$identifier = $this->parseIdentifier($this->args[1]);
-		$nodeId = $this->_getNodeId($class, $identifier);
+		if (is_string($identifier)) {
+			$identifier = array('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', array('conditions' => $identifier))) {
+			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);
 	}
 
 /**

+ 11 - 5
lib/Cake/Controller/Component/Auth/BaseAuthorize.php

@@ -130,16 +130,23 @@ abstract class BaseAuthorize {
  * $this->Auth->mapActions(array('create' => array('add', 'register'));
  * }}}
  *
+ * Or equivalently:
+ *
+ * {{{
+ * $this->Auth->mapActions(array('register' => 'create', 'add' => 'create'));
+ * }}}
+ *
  * Create mappings for custom CRUD operations:
  *
  * {{{
- * $this->Auth->mapActions(array('my_action' => 'admin'));
+ * $this->Auth->mapActions(array('range' => 'search'));
  * }}}
  *
  * You can use the custom CRUD operations to create additional generic permissions
  * that behave like CRUD operations. Doing this will require additional columns on the
- * permissions lookup. When using with DbAcl, you'll have to add additional _admin type columns
- * to the `aros_acos` table.
+ * permissions lookup. For example if one wanted an additional search CRUD operation 
+ * one would create and additional column '_search' in the aros_acos table. One could
+ * create a custom admin CRUD operation for administration functions similarly if needed.
  *
  * @param array $map Either an array of mappings, or undefined to get current values.
  * @return mixed Either the current mappings or null when setting.
@@ -149,9 +156,8 @@ abstract class BaseAuthorize {
 		if (empty($map)) {
 			return $this->settings['actionMap'];
 		}
-		$crud = array('create', 'read', 'update', 'delete');
 		foreach ($map as $action => $type) {
-			if (in_array($action, $crud) && is_array($type)) {
+			if (is_array($type)) {
 				foreach ($type as $typedAction) {
 					$this->settings['actionMap'][$typedAction] = $action;
 				}