Skip to content

Commit

Permalink
Adding additional documentation for CrudAuthorize.
Browse files Browse the repository at this point in the history
Fixes #2034
  • Loading branch information
markstory committed Sep 29, 2011
1 parent 864cb70 commit 9e08095
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion lib/Cake/Controller/Component/Auth/BaseAuthorize.php
Expand Up @@ -116,10 +116,28 @@ public function action($request, $path = '/:plugin/:controller/:action') {
}

/**
* 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)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/AuthComponent.php
Expand Up @@ -477,7 +477,7 @@ public function deny($action = null) {
*
* @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)) {
Expand Down

0 comments on commit 9e08095

Please sign in to comment.