* @package tao */ class AclProxy implements AccessControl { const SERVICE_ID = 'tao/FuncAccessControl'; const CONFIG_KEY_IMPLEMENTATION = 'FuncAccessControl'; const FALLBACK_IMPLEMENTATION_CLASS = 'oat\tao\model\accessControl\func\implementation\NoAccess'; /** * @return FuncAccessControl */ protected static function getImplementation() { return ServiceManager::getServiceManager()->get(self::SERVICE_ID); } /** * Change the implementation of the access control permanently * * @param FuncAccessControl $implementation * @deprecated */ public static function setImplementation(FuncAccessControl $implementation) { ServiceManager::getServiceManager()->register(self::SERVICE_ID, $implementation); } /** * (non-PHPdoc) * @see \oat\tao\model\accessControl\AccessControl::hasAccess() */ public function hasAccess(User $user, $controller, $action, $parameters) { return self::accessPossible($user, $controller, $action); } /** * (non-PHPdoc) * @see \oat\tao\model\accessControl\func\FuncAccessControl::accessPossible() */ public static function accessPossible(User $user, $controller, $action) { return self::getImplementation()->accessPossible($user, $controller, $action); } /** * (non-PHPdoc) * @see \oat\tao\model\accessControl\func\FuncAccessControl::applyRule() */ public static function applyRule(AccessRule $rule) { self::getImplementation()->applyRule($rule); } /** * (non-PHPdoc) * @see \oat\tao\model\accessControl\func\FuncAccessControl::revokeRule() */ public static function revokeRule(AccessRule $rule) { self::getImplementation()->revokeRule($rule); } }