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
    • IRC
    • Slack
    • Paid Support
CakePHP

C Authorization 3.x API

  • Project:
    • Authorization
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.x
      • 3.x
      • 2.x

Namespaces

  • Authorization
    • Command
    • Controller
    • Exception
    • Middleware
    • Policy

Class IdentityDecorator

An decorator implementing the IdentityInterface.

This decorator is intended to wrap the application defined identity object and proxy attributes/methods to and 'mixin' the can() method.

The decorated identity must implement ArrayAccess or be an array.

Namespace: Authorization

Property Summary

  • $authorization protected
    Authorization\AuthorizationServiceInterface

    Authorization Service

  • $identity protected
    ArrayAccess|array

    Identity data

Method Summary

  • __call() public

    Delegate unknown methods to decorated identity.

  • __construct() public

    Constructor

  • __get() public

    Delegate property access to decorated identity.

  • __isset() public

    Delegate property isset to decorated identity.

  • applyScope() public

    Apply authorization scope conditions/restrictions.

  • can() public

    Check whether the current identity can perform an action.

  • canResult() public

    Check whether the current identity can perform an action.

  • getOriginalData() public

    Get the decorated identity

  • offsetExists() public

    Whether a offset exists

  • offsetGet() public

    Offset to retrieve

  • offsetSet() public

    Offset to set

  • offsetUnset() public

    Offset to unset

Method Detail

__call() ¶ public

__call(string $method, array $args): mixed

Delegate unknown methods to decorated identity.

Parameters
string $method

The method being invoked.

array $args

The arguments for the method.

Returns
mixed

__construct() ¶ public

__construct(Authorization\AuthorizationServiceInterface $service, ArrayAccess|array $identity)

Constructor

Parameters
Authorization\AuthorizationServiceInterface $service

The authorization service.

ArrayAccess|array $identity

Identity data

__get() ¶ public

__get(string $property): mixed

Delegate property access to decorated identity.

Parameters
string $property

The property to read.

Returns
mixed

__isset() ¶ public

__isset(string $property): bool

Delegate property isset to decorated identity.

Parameters
string $property

The property to read.

Returns
bool

applyScope() ¶ public

applyScope(string $action, mixed $resource, mixed ...$optionalArgs): mixed

Apply authorization scope conditions/restrictions.

Parameters
string $action
mixed $resource
mixed ...$optionalArgs
Returns
mixed

can() ¶ public

can(string $action, mixed $resource): bool

Check whether the current identity can perform an action.

Parameters
string $action
mixed $resource
Returns
bool

canResult() ¶ public

canResult(string $action, mixed $resource): Authorization\Policy\ResultInterface

Check whether the current identity can perform an action.

Parameters
string $action
mixed $resource
Returns
Authorization\Policy\ResultInterface

getOriginalData() ¶ public

getOriginalData(): ArrayAccess|array

Get the decorated identity

If the decorated identity implements getOriginalData() that method should be invoked to expose the original data.

Returns
ArrayAccess|array

offsetExists() ¶ public

offsetExists(mixed $offset): bool

Whether a offset exists

Parameters
mixed $offset

Offset

Returns
bool
Links
https://secure.php.net/manual/en/arrayaccess.offsetexists.php

offsetGet() ¶ public

offsetGet(mixed $offset): mixed

Offset to retrieve

Parameters
mixed $offset

Offset

Returns
mixed
Links
https://secure.php.net/manual/en/arrayaccess.offsetget.php

offsetSet() ¶ public

offsetSet(mixed $offset, mixed $value): void

Offset to set

Parameters
mixed $offset

The offset to assign the value to.

mixed $value

Value

Returns
void
Links
https://secure.php.net/manual/en/arrayaccess.offsetset.php

offsetUnset() ¶ public

offsetUnset(mixed $offset): void

Offset to unset

Parameters
mixed $offset

Offset

Returns
void
Links
https://secure.php.net/manual/en/arrayaccess.offsetunset.php

Property Detail

$authorization ¶ protected

Authorization Service

Type
Authorization\AuthorizationServiceInterface

$identity ¶ protected

Identity data

Type
ArrayAccess|array
OpenHub
Pingping
Linode
  • 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
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs