explicitly raise Unauthorized in BaseView if user is not allowed to access object
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1666 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
0de032132c
commit
b974605dfb
1 changed files with 3 additions and 3 deletions
|
@ -38,7 +38,7 @@ from zope.publisher.interfaces.browser import IBrowserSkinType
|
||||||
from zope import schema
|
from zope import schema
|
||||||
from zope.schema.vocabulary import SimpleTerm
|
from zope.schema.vocabulary import SimpleTerm
|
||||||
from zope.security import canAccess, canWrite, checkPermission
|
from zope.security import canAccess, canWrite, checkPermission
|
||||||
from zope.security.interfaces import ForbiddenAttribute
|
from zope.security.interfaces import ForbiddenAttribute, Unauthorized
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
from zope.traversing.browser import absoluteURL
|
from zope.traversing.browser import absoluteURL
|
||||||
from zope.traversing.api import getName
|
from zope.traversing.api import getName
|
||||||
|
@ -97,8 +97,8 @@ class BaseView(GenericView):
|
||||||
self.setSkin(self.loopsRoot.skinName)
|
self.setSkin(self.loopsRoot.skinName)
|
||||||
try:
|
try:
|
||||||
if not canAccess(context, 'title'):
|
if not canAccess(context, 'title'):
|
||||||
#raise Unauthorized
|
raise Unauthorized
|
||||||
request.response.redirect('login.html')
|
#request.response.redirect('login.html')
|
||||||
except ForbiddenAttribute: # ignore when testing
|
except ForbiddenAttribute: # ignore when testing
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue