-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More available columns in folder_contents. #83
Conversation
hmm, this should go into 5.1 only, since the type -> portal_type change |
a translated Types was once used here, where it was changed to portal_types: Looks like an accident... |
Regarding "Extend translation ignore list for metadata values in vocabulary ", 1a45137 |
@vangheem can you have a look at this PR, especially these commits?
|
Sorry for packing again too much into one singe PR. At least it's different commits, so if it's necessary (controversy on individual commits), I can split that apart. |
Add ``Creator``, ``Description``, ``end``, ``start`` and ``location`` to the available columns and context attributes for folder_contents. Exclude ``Creator`` from the list of ``_unsafe_metadata``.
…Content" permissions.
…``Type`` instead. ``portal_type`` is now available on the attributes object.
Added most notably `portal_type`, `review_state` and `Subject` but also `exclude_from_nav`, `is_folderish`, `last_comment_date`, `meta_type` and `total_comments` to ``BaseVocabularyView`` ``translate_ignored`` list. Some of them are necessary for frontend logic and others cannot be translated. Fixes #77
lgtm, any reason to not merge? |
yes please |
@terapyon this commit 3b529a3 fixes an issue you introduced in f167266 and 92e9749 |
Thank you for fixing the bug. I will check it out again. |
@@ -183,6 +184,8 @@ def __call__(self): | |||
] | |||
if attributes: | |||
base_path = getNavigationRoot(context) | |||
sm = getSecurityManager() | |||
can_edit = sm.checkPermission('Modify portal content', context) | |||
for vocab_item in results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thet Hi, I'm a bit confused. In folder_contents, the getVocabulary
view is called on the portal. Therefore the context is the portal.
Why does a user need to have "Modify portal content" globally on the portal to be able to view the Creator column in any subfolder?
Why is Creator considered unsafe in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this info exposed could be considered unsafe in some use cases. What I did, was instead of never exposing those unsafe metadata, they are now exposed if the user has "Modify portal content" - on the context itself. Before, these metadata columns were just skipped.
I'm fine with these columns being unsafe, but maybe @vangheem can give some more insight. He added it in:
plone/plone.app.widgets@5055725#diff-83a9a1cb178e6b38717c2427eac08433R27
and
plone/plone.app.widgets@fd5c8cf#diff-cc8621ac4fb1caf4495921abbc02f895R33
Follow up of #78 and obsoletes that. The other one contained the test isolation fixes branch, which failed through the jenkins test. Therefore this new branch with two more features/commits.
Creator
,Description
,end
,start
andlocation
to the available columns and context attributes for folder_contents._unsafe_metadata
if user has "Modify Portal Content" permissions.portal_type
from available columns and useType
instead, which is meant to be read by humans.portal_type
is now available on the attributes object.portal_type
,review_state
andSubject
but alsoexclude_from_nav
,is_folderish
,last_comment_date
,meta_type
andtotal_comments
toBaseVocabularyView
translate_ignored
list.Some of them are necessary for frontend logic and others cannot be translated.
Fixes impossible to insert a picture already available on the website (Internal Image) #77