问题
Default Plone behavior is to display login box when the user tries to access content for which he or she does not have permission.
How to change this behavior so that instead and Unauthorized page is displayed? How to customize this unauthorized page to have custom texts. etc?
回答1:
Customize this template: Products.CMFPlone/Products/CMFPlone/skins/plone_login/require_login.py, either via "old style" skin customization or "new style" jbot customization: http://pypi.python.org/pypi/z3c.jbot (see CMF Objects
section)
回答2:
PAS responds to a 401 Unauthorized error by invoking any challenge plugins, so to avoid the login form deactivate these plugins in acl_users.
A 403 Forbidden should not result in a challenge. However in production mode (but not debug mode) these errors are hidden and they are transformed into 404 Not Found.
回答3:
FYI, there's now also a PAS plugin that only redirects to login form if the UA is a browser:
https://pypi.python.org/pypi/koodaamo.pas.browseronlyredirect/
来源:https://stackoverflow.com/questions/6351610/make-plone-give-proper-403-forbidden-errors