Class Permission
Permissions linking AROs with ACOs
- AppModel
- Permission
Package: Cake\Model
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Model/Permission.php
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Model/Permission.php
Properties summary
-
$actsAs
publicarray
No behaviors for this model -
$belongsTo
publicarray
Permissions link AROs with ACOs -
$cacheQueries
publicboolean
Explicitly disable in-memory query caching -
$useTable
publicstring
Override default table name
Method Summary
-
__construct() public
Constructor, used to tell this model to use the database configured for ACL
-
allow() public
Allow $aro to have access to action $actions in $aco -
check() public
Checks if the given $aro has access to action $action in $aco -
getAclLink() public
Get an array of access-control links between the given Aro and Aco -
getAcoKeys() public
Get the crud type keys
Method Detail
__construct() public ¶
__construct( )
Constructor, used to tell this model to use the database configured for ACL
allow() 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 $actions optional '*'
- Action (defaults to *) Invalid permissions will result in an exception
- integer $value optional 1
- Value to indicate access type (1 to give access, -1 to deny, 0 to inherit)
Returns
boolean
Success
Success
Throws
check() 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 $action optional '*'
- Action (defaults to *)
Returns
boolean
Success (true if ARO has access to action in ACO, false otherwise)
Success (true if ARO has access to action in ACO, false otherwise)
getAclLink() 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
array
Indexed array with: 'aro', 'aco' and 'link'
Indexed array with: 'aro', 'aco' and 'link'
getAcoKeys() public ¶
getAcoKeys( array $keys )
Get the crud type keys
Parameters
- array $keys
- Permission schema
Returns
array
permission keys
permission keys