mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 10:36:16 +00:00
Adding a doc block.
This commit is contained in:
parent
16b3beec5e
commit
67c9acbc94
1 changed files with 33 additions and 1 deletions
|
@ -1,6 +1,38 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
*
|
||||||
|
* Licensed under The MIT License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An authorization adapter for AuthComponent. Provides the ability to authorize using a controller callback.
|
||||||
|
* Your controller's isAuthorized() method should return a boolean to indicate whether or not the user is authorized.
|
||||||
|
*
|
||||||
|
* {{{
|
||||||
|
* function isAuthorized($user) {
|
||||||
|
* if (!empty($this->request->params['admin'])) {
|
||||||
|
* return $user['role'] == 'admin';
|
||||||
|
* }
|
||||||
|
* return !empty($user);
|
||||||
|
* }
|
||||||
|
* }}}
|
||||||
|
*
|
||||||
|
* the above is simple implementation that would only authorize users of the 'admin' role to access
|
||||||
|
* admin routing.
|
||||||
|
*
|
||||||
|
* @package cake.libs.controller.components.auth
|
||||||
|
* @since 2.0
|
||||||
|
* @see AuthComponent::$authenticate
|
||||||
|
*/
|
||||||
class ControllerAuthorize {
|
class ControllerAuthorize {
|
||||||
/**
|
/**
|
||||||
* Controller for the request.
|
* Controller for the request.
|
||||||
|
|
Loading…
Add table
Reference in a new issue