Class Permission

Permissions linking AROs with ACOs

AppModel
Extended by Permission
Package: Cake\Model
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Model/Permission.php

Properties summary

  • $actsAs public
    array
    No behaviors for this model
  • $belongsTo public
    array
    Permissions link AROs with ACOs
  • $cacheQueries public
    boolean
    Explicitly disable in-memory query caching
  • $useTable public
    string
    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()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 $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

Throws

AclException
on 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 $action optional '*'
Action (defaults to *)

Returns

boolean
Success (true if ARO has access to action in ACO, false otherwise)
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'

getAcoKeys()source public

getAcoKeys( array $keys )

Get the crud type keys

Parameters

array $keys
Permission schema

Returns

array
permission keys

Properties detail

$actsAssource

public array

No behaviors for this model

null

$belongsTosource

public array

Permissions link AROs with ACOs

array('Aro', 'Aco')

$cacheQueriessource

public boolean

Explicitly disable in-memory query caching

false

$useTablesource

public string

Override default table name

'aros_acos'

© 2005–2017 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.10/class-Permission.html