CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.1 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.1
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
    • Network
      • Email
      • Http
    • Routing
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • PhpAcl
  • PhpAco
  • PhpAro

Class PhpAro

Access Request Object

Package: Cake\Controller\Component\Acl
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/Acl/PhpAcl.php

Constants summary

  • string
    DEFAULT_ROLE ¶
    'Role/default'

Properties summary

  • $_tree protected
    array
    internal ARO representation
  • $aliases public
    array
    aliases to map
  • $map public
    array
    map external identifiers. E.g. if

Method Summary

  • __construct() public
  • addAlias() public
    adds one or more aliases to the internal map. Overwrites existing entries.
  • addRole() public
    adds a new ARO to the tree
  • build() public
    build an ARO tree structure for internal processing
  • resolve() public

    resolve an ARO identifier to an internal ARO string using the internal mapping information.

  • roles() public

    From the perspective of the given ARO, walk down the tree and collect all inherited AROs levelwise such that AROs from different branches with equal distance to the requested ARO will be collected at the same index. The resulting array will contain a prioritized list of (list of) roles ordered from the most distant AROs to the requested one itself.

Method Detail

__construct() public ¶

__construct( array $aro = array() , array $map = array() , array $aliases = array() )

addAlias() public ¶

addAlias( array $alias )

adds one or more aliases to the internal map. Overwrites existing entries.

Parameters
array $alias
alias from => to (e.g. Role/13 -> Role/editor)

addRole() public ¶

addRole( array $aro )

adds a new ARO to the tree

Parameters
array $aro
one or more ARO records

build() public ¶

build( array $aros )

build an ARO tree structure for internal processing

Parameters
array $aros
array of AROs as key and their inherited AROs as values

resolve() public ¶

resolve( mixed $aro )

resolve an ARO identifier to an internal ARO string using the internal mapping information.

Parameters
mixed $aro
ARO identifier (User.jeff, array('User' => ...), etc)
Returns
string
internal aro string (e.g. User/jeff, Role/default)

roles() public ¶

roles( mixed $aro )

From the perspective of the given ARO, walk down the tree and collect all inherited AROs levelwise such that AROs from different branches with equal distance to the requested ARO will be collected at the same index. The resulting array will contain a prioritized list of (list of) roles ordered from the most distant AROs to the requested one itself.

Parameters
mixed $aro
An ARO identifier
Returns
array
prioritized AROs

Properties detail

$_tree ¶

protected array

internal ARO representation

array()

$aliases ¶

public array

aliases to map

array()

$map ¶

public array

map external identifiers. E.g. if

array('User' => array('username' => 'jeff', 'role' => 'editor'))

is passed as an ARO to one of the methods of AclComponent, PhpAcl will check if it can be resolved to an User or a Role defined in the configuration file.

See
app/Config/acl.php
array(
    'User' => 'User/username',
    'Role' => 'User/role',
)
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs