dataObj->getResource() as $resource) { $acl->addResource(new Zend_Acl_Resource($resource)); } if ($userId) { $acl->addRole(new Zend_Acl_Role($userId)); if ($userId == App_Doc_Site::ADMIN_ID) { $acl->allow($userId); } else { $rules = $this->dataObj->getRule($userId); foreach ($rules as $rule) { $acl->allow( $rule['userId'], $rule['resourceName'], $rule['privilegeName'] ); } } } return $acl; } }