Jiew Meng
Jiew Meng

Reputation: 88337

Zend Framework: What exception to use for "Access denied"/"unauthorized access" from ACL?

i am using Zend Framework Zend_Acl i am wanting to throw an exception when the user is denied access to a resource. which exception class do i use?

Upvotes: 0

Views: 1323

Answers (2)

N D
N D

Reputation: 737

You could use

throw new Zend_Controller_Action_Exception('Forbidden', 403);

Upvotes: 1

robertbasic
robertbasic

Reputation: 4335

AFAIK you don't have a specific exception for that, if that's what you're asking. Create your own exception class which extends from Zend_Exception and throw that.

Upvotes: 0

Related Questions