acl_base.php

Go to the documentation of this file.
00001 <?php
00002 /* SVN FILE: $Id: acl__base_8php-source.html 675 2008-12-26 00:27:14Z gwoo $ */
00003 /**
00004  * Access Control List abstract class.
00005  *
00006  * Long description for file
00007  *
00008  * PHP versions 4 and 5
00009  *
00010  * CakePHP(tm) :  Rapid Development Framework <http://www.cakephp.org/>
00011  * Copyright 2005-2008, Cake Software Foundation, Inc.
00012  *                              1785 E. Sahara Avenue, Suite 490-204
00013  *                              Las Vegas, Nevada 89104
00014  *
00015  * Licensed under The MIT License
00016  * Redistributions of files must retain the above copyright notice.
00017  *
00018  * @filesource
00019  * @copyright       Copyright 2005-2008, Cake Software Foundation, Inc.
00020  * @link                http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
00021  * @package         cake
00022  * @subpackage      cake.cake.libs.controller.components
00023  * @since           CakePHP(tm) v 0.10.0.1232
00024  * @version         $Revision: 675 $
00025  * @modifiedby      $LastChangedBy: gwoo $
00026  * @lastmodified    $Date: 2008-12-25 16:27:14 -0800 (Thu, 25 Dec 2008) $
00027  * @license         http://www.opensource.org/licenses/mit-license.php The MIT License
00028  */
00029 /**
00030  * Access Control List abstract class. Not to be instantiated.
00031  * Subclasses of this class are used by AclComponent to perform ACL checks in Cake.
00032  *
00033  * @package     cake
00034  * @subpackage  cake.cake.libs.controller.components
00035  * @abstract
00036  */
00037 class AclBase extends Object {
00038 /**
00039  * This class should never be instantiated, just subclassed.
00040  *
00041  * No instantiations or constructor calls (even statically)
00042  *
00043  * @return AclBase
00044  * @abstract
00045  */
00046     function __construct() {
00047         if (strcasecmp(get_class($this), "AclBase") == 0 || !is_subclass_of($this, "AclBase")) {
00048             trigger_error("[acl_base] The AclBase class constructor has been called, or the class was instantiated. This class must remain abstract. Please refer to the Cake docs for ACL configuration.", E_USER_ERROR);
00049             return null;
00050         }
00051     }
00052 /**
00053  * Empty method to be overridden in subclasses
00054  *
00055  * @param string $aro
00056  * @param string $aco
00057  * @param string $action
00058  * @abstract
00059  */
00060     function check($aro, $aco, $action = "*") {
00061     }
00062 }
00063 ?>