Class Permission
Permissions linking AROs with ACOs
- AppModel
-
Permission
Package: Cake\Model
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/Model/Permission.php
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/Model/Permission.php
Properties summary
-
$actsAspublicNo behaviors for this modelarray -
$belongsTopublicPermissions link AROs with ACOsarray -
$cacheQueriespublicExplicitly disable in-memory query cachingboolean -
$useTablepublicOverride default table namestring
Method Summary
- __construct() public
Constructor, used to tell this model to use the database configured for ACL
- allow() publicAllow $aro to have access to action $actions in $aco
- check() publicChecks if the given $aro has access to action $action in $aco
- getAclLink() publicGet an array of access-control links between the given Aro and Aco
- getAcoKeys() publicGet the crud type keys
Method Detail
__construct()source public
__construct( )
Constructor, used to tell this model to use the database configured for ACL
allow()source public
allow( string $aro , string $aco , string $actions '*' , integer $value 1 )
Allow $aro to have access to action $actions in $aco
Parameters
- string
$aro - ARO The requesting object identifier.
- string
$aco - ACO The controlled object identifier.
- string
$actionsoptional '*' - Action (defaults to *) Invalid permissions will result in an exception
- integer
$valueoptional 1 - Value to indicate access type (1 to give access, -1 to deny, 0 to inherit)
Returns
booleanSuccess
Throws
AclExceptionon Invalid permission key.
check()source public
check( string $aro , string $aco , string $action '*' )
Checks if the given $aro has access to action $action in $aco
Parameters
- string
$aro - ARO The requesting object identifier.
- string
$aco - ACO The controlled object identifier.
- string
$actionoptional '*' - Action (defaults to *)
Returns
booleanSuccess (true if ARO has access to action in ACO, false otherwise)
getAclLink()source public
getAclLink( string $aro , string $aco )
Get an array of access-control links between the given Aro and Aco
Parameters
- string
$aro - ARO The requesting object identifier.
- string
$aco - ACO The controlled object identifier.
Returns
arrayIndexed array with: 'aro', 'aco' and 'link'
getAcoKeys()source public
getAcoKeys( array $keys )
Get the crud type keys
Parameters
- array
$keys - Permission schema
Returns
arraypermission keys
Properties detail
© 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.
https://api.cakephp.org/2.9/class-Permission.html