/** * Returns true if and only if the assertion conditions are met * * This method is passed the ACL, Role, Resource, and privilege to which * the authorization query applies. If the $role, $resource, or $privilege * parameters are null, it means that the query applies to all Roles, * Resources, or privileges, respectively. * * @param Zend_Acl $acl * @param Zend_Acl_Role_Interface $role * @param Zend_Acl_Resource_Interface $resource * @param string $privilege * @return boolean */ public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null, $privilege = null) { if (!$role instanceof UserModel) { throw new Exception('Role must be an instance of UserModel'); } if (!$resource instanceof OrgModelAbstract) { throw new Exception('Resource must be an instance of OrgModelAbstract'); } $type = $resource->getType(); if (!isset($this->_types[$type])) { throw new Exception('Resource has an undefined organization type'); } $org = $role->getOrganization(); $orgType = $org->getType(); return $this->_diff($this->_types[$orgType], $this->_types[$type]); }