Class BaseAuthorize
Abstract base authorization adapter for AuthComponent.
Direct Subclasses
Package: Cake\Controller\Component\Auth
Since: 2.0
See: AuthComponent::$authenticate
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Controller/Component/Auth/BaseAuthorize.php
Properties summary
-
$_Collection
protectedComponent collection instance for getting more components. -
$_Controller
protectedController for the request. -
$settings
publicarray
Settings for authorize objects.
Method Summary
-
__construct() public
Constructor -
action() public
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.
-
authorize() abstract public
Checks user authorization. -
controller() public
Accessor to the controller object. -
mapActions() public
Maps crud actions to actual action names. Used to modify or get the current mapped actions.
Method Detail
__construct() public ¶
__construct( ComponentCollection
$collection , string $settings = array() )
Constructor
Parameters
-
ComponentCollection
$collection - The controller for this request.
- string $settings optional array()
- An array of settings. This class does not use any settings.
action() 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 $path optional '/:plugin/:controller/:action'
Returns
the action path for the given request.
authorize() abstract public ¶
authorize( array $user , CakeRequest
$request )
Checks user authorization.
Parameters
- array $user
- Active user data
-
CakeRequest
$request
Returns
controller() public ¶
controller( Controller
$controller = null )
Accessor to the controller object.
Parameters
-
Controller
$controller optional null - null to get, a controller to set.
Returns
Throws
mapActions() 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')); }}}
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.
Parameters
- array $map optional array()
- Either an array of mappings, or undefined to get current values.
Returns
Either the current mappings or null when setting.
See
Properties detail
$_Collection ¶
ComponentCollection
Component collection instance for getting more components.
$settings ¶
Settings for authorize objects.
actionPath
- The path to ACO nodes that contains the nodes for controllers. Used as a prefix when calling $this->action();actionMap
- Action -> crud mappings. Used by authorization objects that want to map actions to CRUD roles.userModel
- Model name that ARO records can be found under. Defaults to 'User'.
array( 'actionPath' => null, 'actionMap' => array( 'index' => 'read', 'add' => 'create', 'edit' => 'update', 'view' => 'read', 'delete' => 'delete', 'remove' => 'delete' ), 'userModel' => 'User' )