From f7473c8644403a7fe3ff8c07e8b291715b996645 Mon Sep 17 00:00:00 2001 From: ksuess Date: Fri, 5 Nov 2021 09:30:48 +0100 Subject: [PATCH 1/2] Update vocabulary.py: deferredimport of 'DEFAULT_PERMISSION', 'DEFAULT_PERMISSION_SECURE', 'PERMISSIONS' from plone.app.vocabularies --- plone/app/content/browser/vocabulary.py | 32 ++++++++++++++++++------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/plone/app/content/browser/vocabulary.py b/plone/app/content/browser/vocabulary.py index 7db38fc7..7f5876ca 100644 --- a/plone/app/content/browser/vocabulary.py +++ b/plone/app/content/browser/vocabulary.py @@ -33,19 +33,33 @@ import itertools +import zope.deferredimport + logger = getLogger(__name__) MAX_BATCH_SIZE = 500 # prevent overloading server -DEFAULT_PERMISSION = "View" -DEFAULT_PERMISSION_SECURE = "Modify portal content" -PERMISSIONS = { - "plone.app.vocabularies.Catalog": "View", - "plone.app.vocabularies.Keywords": "Modify portal content", - "plone.app.vocabularies.SyndicatableFeedItems": "Modify portal content", - "plone.app.vocabularies.Users": "Modify portal content", - "plone.app.multilingual.RootCatalog": "View", -} +zope.deferredimport.defineFrom( + 'plone.app.vocabularies.security', + 'DEFAULT_PERMISSION', 'DEFAULT_PERMISSION_SECURE', 'PERMISSIONS', +) +if not 'PERMISSIONS' in globals(): + DEFAULT_PERMISSION = "View" + DEFAULT_PERMISSION_SECURE = "Modify portal content" + PERMISSIONS = { + "plone.app.vocabularies.Catalog": "View", + "plone.app.vocabularies.Keywords": "Modify portal content", + "plone.app.vocabularies.SyndicatableFeedItems": "Modify portal content", + "plone.app.vocabularies.Users": "Modify portal content", + "plone.app.multilingual.RootCatalog": "View", + } + deprecated("DEFAULT_PERMISSION", + "Import from plone.app.vocabularies.security instead.") + deprecated("DEFAULT_PERMISSION_SECURE", + "Import from plone.app.vocabularies.security instead.") + deprecated("PERMISSIONS", + "Import from plone.app.vocabularies.security instead.") + TRANSLATED_IGNORED = [ "author_name", "cmf_uid", From bf36d19bf7316b82bd0a5e3fc8fc155c6a3b631f Mon Sep 17 00:00:00 2001 From: ksuess Date: Fri, 5 Nov 2021 09:35:16 +0100 Subject: [PATCH 2/2] Create 237.bugfix --- news/237.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/237.bugfix diff --git a/news/237.bugfix b/news/237.bugfix new file mode 100644 index 00000000..c69e4f77 --- /dev/null +++ b/news/237.bugfix @@ -0,0 +1 @@ +Move 'DEFAULT_PERMISSION', 'DEFAULT_PERMISSION_SECURE', 'PERMISSIONS' to plone.app.vocabularies.security [ksuess]