> [CODE]
> class Home_Acl_Assert_Profile implements Zend_Acl_Assert_Interface
> {
> public function assert(Zend_Acl $acl,Zend_Acl_Role_Interface
> $role=null, Zend_Acl_Resource_Interface $resource=null,$privileges=null)
> {
> $auth = Zend_Auth::getInstance();
> if ($auth->hasIdentity()) {
> $request = new Zend_Controller_Request_Http();
$request = Zend_Controller_Front::getInstance()->getRequest();
instead of what is above.
> $requestid = $request->getQuery('id');
> $identity = $auth->getIdentity();
> if($identity->role == 'admin' || ($requestid == $identity->uid)) {
> return "allowed";
> } else {
> return "denied";
> }
> } else {
> return "denied";
> }
> return "denied";
> }
> }
> [/CODE]
>
> If I request /user/profile/?id=1 the assertion class recognizes the ID
> parameter (returns allowed). If I use /user/profile/id/1, if fails
> (returns denied). Any thoughts on how I can get the assertion class to
> recognize the parameters?
-ralph
没有评论:
发表评论