work in progress: more flexible permission checks
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3193 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
396cc946d6
commit
0612728d9b
2 changed files with 8 additions and 3 deletions
|
@ -116,11 +116,14 @@ class BaseView(GenericView, I18NView):
|
|||
# TODO: get rid of removeSecurityProxy() call - not yet...
|
||||
self.context = removeSecurityProxy(context)
|
||||
try:
|
||||
if not canAccessObject(context):
|
||||
raise Unauthorized('%r: title' % (context))
|
||||
if not self.checkPermissions():
|
||||
raise Unauthorized('%r: title' % (self.context))
|
||||
except ForbiddenAttribute: # ignore when testing
|
||||
pass
|
||||
|
||||
def checkPermissions(self):
|
||||
return canAccessObject(self.context)
|
||||
|
||||
@Lazy
|
||||
def conceptMacros(self):
|
||||
return concept_macros.macros
|
||||
|
|
|
@ -106,7 +106,9 @@ class NodeView(BaseView):
|
|||
subMacros=[i18n_macros.macros['language_switch']])
|
||||
cm.register('portlet_left', 'navigation', title='Navigation',
|
||||
subMacro=node_macros.macros['menu'])
|
||||
if canWrite(self.context, 'title'):
|
||||
if canWrite(self.context, 'title') or (
|
||||
self.virtualTargetObject is not None and
|
||||
canWrite(self.virtualTargetObject, 'title')):
|
||||
#cm.register('portlet_right', 'clipboard', title='Clipboard',
|
||||
# subMacro=self.template.macros['clipboard'])
|
||||
# this belongs to loops.organize
|
||||
|
|
Loading…
Add table
Reference in a new issue