Skip to content

Commit 9e08095

Browse files
committed
Adding additional documentation for CrudAuthorize.
Fixes #2034
1 parent 864cb70 commit 9e08095

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

lib/Cake/Controller/Component/Auth/BaseAuthorize.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,28 @@ public function action($request, $path = '/:plugin/:controller/:action') {
116116
}
117117

118118
/**
119-
* Maps crud actions to actual controller names. Used to modify or get the current mapped actions.
119+
* Maps crud actions to actual action names. Used to modify or get the current mapped actions.
120+
*
121+
* Create additional mappings for a standard CRUD operation:
122+
*
123+
* {{{
124+
* $this->Auth->mapActions(array('create' => array('add', 'register'));
125+
* }}}
126+
*
127+
* Create mappings for custom CRUD operations:
128+
*
129+
* {{{
130+
* $this->Auth->mapActions(array('my_action' => 'admin'));
131+
* }}}
132+
*
133+
* You can use the custom CRUD operations to create additional generic permissions
134+
* that behave like CRUD operations. Doing this will require additional columns on the
135+
* permissions lookup. When using with DbAcl, you'll have to add additional _admin type columns
136+
* to the `aros_acos` table.
120137
*
121138
* @param mixed $map Either an array of mappings, or undefined to get current values.
122139
* @return mixed Either the current mappings or null when setting.
140+
* @see AuthComponent::mapActions()
123141
*/
124142
public function mapActions($map = array()) {
125143
if (empty($map)) {

lib/Cake/Controller/Component/AuthComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ public function deny($action = null) {
477477
*
478478
* @param array $map Actions to map
479479
* @return void
480-
* @link http://book.cakephp.org/view/1260/mapActions
480+
* @see BaseAuthorize::mapActions()
481481
*/
482482
public function mapActions($map = array()) {
483483
if (empty($this->_authorizeObjects)) {

0 commit comments

Comments
 (0)