diff --git a/browser/common.py b/browser/common.py index 056073b..50001b1 100644 --- a/browser/common.py +++ b/browser/common.py @@ -56,6 +56,7 @@ from cybertools.stateful.interfaces import IStateful from cybertools.text import mimetypes from cybertools.typology.interfaces import IType, ITypeManager from loops.common import adapted +from loops.config.base import DummyOptions from loops.i18n.browser import I18NView from loops.interfaces import IResource, IView, INode from loops.organize.tracking import access @@ -114,13 +115,9 @@ class BaseView(GenericView, I18NView): super(BaseView, self).__init__(context, request) # TODO: get rid of removeSecurityProxy() call - not yet... self.context = removeSecurityProxy(context) - #self.context = context - #self.setSkin(self.loopsRoot.skinName) - #self.checkLanguage() try: if not canAccessObject(context): - raise Unauthorized - #request.response.redirect('login.html') + raise Unauthorized('%r: title' % (context)) except ForbiddenAttribute: # ignore when testing pass @@ -393,8 +390,7 @@ class BaseView(GenericView, I18NView): @Lazy def options(self): - #return IOptions(self.context) - return IOptions(self.adapted) + return component.queryAdapter(self.adapted, IOptions) or DummyOptions() @Lazy def globalOptions(self): diff --git a/browser/configure.zcml b/browser/configure.zcml index c36e68c..61e9645 100644 --- a/browser/configure.zcml +++ b/browser/configure.zcml @@ -111,14 +111,13 @@ title="loops Container" description="A top-level loops container" permission="zope.ManageContent" - view="AddLoopsContainer.html" - /> + view="AddLoopsContainer.html" /> + index="zope.View" + contents="loops.ManageSite" + add="loops.ManageSite" /> + permission="zope.ManageContent" /> + index="loops.ManageSite" + contents="loops.ManageSite" + add="loops.ManageSite" /> @@ -243,8 +242,9 @@ + index="loops.ManageSite" + contents="loops.ManageSite" + add="loops.ManageSite" /> @@ -354,55 +354,44 @@ schema="loops.interfaces.IViewManager" content_factory="loops.view.ViewManager" template="add.pt" - permission="zope.ManageContent" - /> + permission="zope.ManageContent" /> + index="zope.View" + add="zope.ManageContent" /> + menu="zmi_views" title="Contents" /> + index="loops.ManageSite" + add="loops.ManageSite" /> + permission="loops.ManageSite" + menu="zmi_views" title="Contents" /> + file="node_icon.gif" /> - - + menu="zmi_views" title="Contents" /> - - + view="AddLoopsNode.html" /> Error) return parents and parents[0] or None def setConceptType(self, concept): diff --git a/config/base.py b/config/base.py index 70ca94a..1010b8d 100644 --- a/config/base.py +++ b/config/base.py @@ -73,7 +73,8 @@ class LoopsOptions(Options): def parseContextOptions(self): def result(): - for opt in self.context.options: + options = getattr(self.context, 'options', []) + for opt in options: parts = opt.split(':', 1) key = parts[0].strip() if len(parts) == 1: @@ -94,3 +95,8 @@ class QueryOptions(LoopsOptions): adapts(IQueryConcept) + +class DummyOptions(Options): + + def __getitem__(self, key): + return [] diff --git a/configure.zcml b/configure.zcml index fb088c1..1511a81 100644 --- a/configure.zcml +++ b/configure.zcml @@ -183,9 +183,6 @@ - diff --git a/locales/de/LC_MESSAGES/loops.mo b/locales/de/LC_MESSAGES/loops.mo index 2d9b225..b296121 100644 Binary files a/locales/de/LC_MESSAGES/loops.mo and b/locales/de/LC_MESSAGES/loops.mo differ diff --git a/locales/de/LC_MESSAGES/loops.po b/locales/de/LC_MESSAGES/loops.po index 4049f2b..4d424a8 100644 --- a/locales/de/LC_MESSAGES/loops.po +++ b/locales/de/LC_MESSAGES/loops.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: $Id$\n" "POT-Creation-Date: 2007-05-22 12:00 CET\n" -"PO-Revision-Date: 2008-12-15 12:00 CET\n" +"PO-Revision-Date: 2009-01-26 12:00 CET\n" "Last-Translator: Helmut Merz \n" "Language-Team: loops developers \n" "MIME-Version: 1.0\n" @@ -478,3 +478,18 @@ msgstr "Zielobjekt zuordnen" msgid "Search Term" msgstr "Suchbegriff" +msgid "Day" +msgstr "Tag" + +msgid "Start" +msgstr "Beginn" + +msgid "End" +msgstr "Ende" + +msgid "Duration" +msgstr "Dauer" + +msgid "Effort" +msgstr "Aufwand" + diff --git a/resource.py b/resource.py index 0cfe549..6ab2838 100644 --- a/resource.py +++ b/resource.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# Copyright (c) 2009 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -114,7 +114,7 @@ class Resource(Image, Contained): typePred = cm.getTypePredicate() if typePred is None: return None - concepts = self.getConcepts([typePred]) + concepts = self.getConcepts([typePred], noSecurityCheck=True) # TODO (?): check for multiple types (->Error) return concepts and concepts[0] or cm.get('file', None) def setResourceType(self, concept): diff --git a/security.zcml b/security.zcml index 000a95e..c53c138 100644 --- a/security.zcml +++ b/security.zcml @@ -15,26 +15,43 @@ id="loops.ManageSite" title="[loops-manage-site-permission] loops: Manage Site" /> + + + + + + + + + + +