Class BaseAuthorize
Abstract base authorization adapter for AuthComponent.
Direct known subclasses
ActionsAuthorize, ControllerAuthorize, CrudAuthorizePackage: Cake\Controller\Component\Auth
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Since: 2.0
See:
AuthComponent::$authenticateLocated at Cake/Controller/Component/Auth/BaseAuthorize.php
Method Detail
__constructsource public
__construct( ComponentCollection $collection , string $settings array() )
Constructor
Parameters
-
ComponentCollection$collection - The controller for this request.
- string
$settingsoptional array() - An array of settings. This class does not use any settings.
actionsource public
action( CakeRequest $request , string $path '/:plugin/:controller/:action' )
Get the action path for a given request. Primarily used by authorize objects that need to get information about the plugin, controller, and action being invoked.
Parameters
-
CakeRequest$request - The request a path is needed for.
- string
$pathoptional '/:plugin/:controller/:action' - Path format.
Returns
stringthe action path for the given request.
authorizesource abstract public
authorize( array $user , CakeRequest $request )
Checks user authorization.
Parameters
- array
$user - Active user data
-
CakeRequest$request - Request instance.
Returns
booleanbool
controllersource public
controller( Controller $controller null )
Accessor to the controller object.
Parameters
-
Controller$controlleroptional null - null to get, a controller to set.
Returns
mixedmixed
Throws
CakeExceptionCakeException
mapActionssource public
mapActions( array $map array() )
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'));
Or equivalently:
$this->Auth->mapActions(array('register' => 'create', 'add' => 'create'));
Create mappings for custom CRUD operations:
$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. 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.
Parameters
- array
$mapoptional array() - Either an array of mappings, or undefined to get current values.
Returns
mixedEither the current mappings or null when setting.
See
AuthComponent::mapActions()Properties summary
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/2.7/class-BaseAuthorize.html