Zend_Auth and Zend_Acl have been integrated into the DotKernel, starting with version 1.5.0

With the integration of these two major components for user authorization and access we completely refactored the User and Admin models by using Dot_Auth and Dot_Acl classes.

The Dot_Auth class authenticates the user by checking the database – Zend_Auth_Adapter_DbTable.

private function _getAuthAdapter($who)
		$dbAdapter = Zend_Registry::get('database');
		$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);
		return $authAdapter;

ACL roles (user types) and permissions are configured in the configs/acl/role.xml file.
In DotKernel there are 3 roles: guest, user and admin.
The resources for ACL are taken from configs/router.xml – see controllers tag.

The Dot_Acl class

  • controls the user access (ACL – Access Controller Layer),
  • is used for setting and checking the permissions of a user,
  • uses Zend_Acl,  for checking if a role (user) has access to a resource (controller)

Dot_Auth calls the isAllowed method from Dot_Acl which authenticates the user.

// instantiate Zend_Acl
$this->acl = new Zend_Acl();
public function isAllowed($role)
		$resource = $this->requestControllerProcessed;
		$privillege = $this->requestAction;
			return FALSE;	
			return $this->acl->isAllowed($role, $resource, $privillege);

IndexController.php is calling Dot_Auth

$dotAuth = Dot_Auth::getInstance();

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>