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

StackOverflow https://stackoverflow.com/questions/3393475

문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

You could use

throw new Zend_Controller_Action_Exception('Forbidden', 403);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top