hide 'create resource' action if 'hideCreateResource' global option is set
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3673 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
231e2871a1
commit
8417ebf490
3 changed files with 4 additions and 2 deletions
|
@ -516,6 +516,8 @@ class BaseView(GenericView, I18NView):
|
||||||
return not IUnauthenticatedPrincipal.providedBy(self.request.principal)
|
return not IUnauthenticatedPrincipal.providedBy(self.request.principal)
|
||||||
|
|
||||||
def checkAction(self, name, category, target):
|
def checkAction(self, name, category, target):
|
||||||
|
if name in ('create_resource',):
|
||||||
|
return not self.globalOptions('hideCreateResource')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def openEditWindow(self, viewName='edit.html'):
|
def openEditWindow(self, viewName='edit.html'):
|
||||||
|
|
|
@ -380,7 +380,7 @@ class ConceptView(BaseView):
|
||||||
def checkAction(self, name, category, target):
|
def checkAction(self, name, category, target):
|
||||||
if name in (self.typeOptions('hide_action.' + category) or []):
|
if name in (self.typeOptions('hide_action.' + category) or []):
|
||||||
return False
|
return False
|
||||||
return True
|
return super(ConceptView, self).checkAction(name, category, target)
|
||||||
|
|
||||||
|
|
||||||
class ConceptRelationView(ConceptView, BaseRelationView):
|
class ConceptRelationView(ConceptView, BaseRelationView):
|
||||||
|
|
|
@ -474,7 +474,7 @@ class NodeView(BaseView):
|
||||||
def checkAction(self, name, category, target):
|
def checkAction(self, name, category, target):
|
||||||
if name in ('create_resource',) and target is not None:
|
if name in ('create_resource',) and target is not None:
|
||||||
return target.checkAction(name, category, target)
|
return target.checkAction(name, category, target)
|
||||||
return True
|
return super(NodeView, self).checkAction(name, category, target)
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def popupCreateObjectForm(self):
|
def popupCreateObjectForm(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue