Hello,

 

i just want to know if there's a good solution to get the request-object
within the assert method? I think there are several situations where the
request object is required to determine if the client has access to the
requested resource.

 

i.e. 

 

<?php

class Project_Acl_Assert_ForumPostEdit implements Zend_Acl_Assert_Interface

{

  public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role =
null, Zend_Acl_Resource_Interface $resource = null, $privilege = null)

  {

    // get the request object

    // get the requested post

   $posts = new ForumPosts();

   $post  = $posts->find($req->_getParam("id"))->current();

 

    // compare author with authenticated client

    return Zend_Auth::getInstance()->getIdentity()->id == $post->author_id;

  }

}

?>

 

with kind regards,

Daniel

Reply via email to