From 9e080951b1a91fc4decd106a8a6c2dbcd1e0b373 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 28 Sep 2011 23:24:21 -0400 Subject: [PATCH] Adding additional documentation for CrudAuthorize. Fixes #2034 --- .../Component/Auth/BaseAuthorize.php | 20 ++++++++++++++++++- .../Controller/Component/AuthComponent.php | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Controller/Component/Auth/BaseAuthorize.php b/lib/Cake/Controller/Component/Auth/BaseAuthorize.php index d68f7b1b6..926f5186d 100644 --- a/lib/Cake/Controller/Component/Auth/BaseAuthorize.php +++ b/lib/Cake/Controller/Component/Auth/BaseAuthorize.php @@ -116,10 +116,28 @@ abstract class BaseAuthorize { } /** - * Maps crud actions to actual controller names. Used to modify or get the current mapped actions. + * Maps crud actions to actual action names. Used to modify or get the current mapped actions. + * + * Create additional mappings for a standard CRUD operation: + * + * {{{ + * $this->Auth->mapActions(array('create' => array('add', 'register')); + * }}} + * + * Create mappings for custom CRUD operations: + * + * {{{ + * $this->Auth->mapActions(array('my_action' => 'admin')); + * }}} + * + * 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. * * @param mixed $map Either an array of mappings, or undefined to get current values. * @return mixed Either the current mappings or null when setting. + * @see AuthComponent::mapActions() */ public function mapActions($map = array()) { if (empty($map)) { diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 777fd9faf..b33cb5582 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -477,7 +477,7 @@ class AuthComponent extends Component { * * @param array $map Actions to map * @return void - * @link http://book.cakephp.org/view/1260/mapActions + * @see BaseAuthorize::mapActions() */ public function mapActions($map = array()) { if (empty($this->_authorizeObjects)) {