-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
AccessInactivePortalContent in catalog queries #1952
Conversation
a5d8c10
to
dc6b242
Compare
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.
Overall I think this is fine. I would like to have someone else to look at it before merging.
Products/CMFPlone/CatalogTool.py
Outdated
|
||
paths = query_kw.get('path', False) | ||
if not paths: | ||
return [] |
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.
Why an empty list here?
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.
That's a leftover from refactoring this method a couple of times... I'll change to False
.
allow = True | ||
for ob in objs: | ||
allow = allow and\ | ||
_checkPermission(AccessInactivePortalContent, ob) |
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.
If you have more than one paths given, one not allowed will result in not showing the other path as well. Is it intended? Overall I think it's impossible (or at least difficult to do in a fast way) to implement.
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.
Yes, that's indented - I think it's better to be conservative here instead of showing too much content which shouldn't be shown.
Also, it's quite uncommon that two paths are used.
@mauritsvanrees since your also deeper into security, what do you think of this change? |
dc6b242
to
2822b6e
Compare
Checked for ``AccessInactivePortalContent`` for each path in a catalog query. This solves a problem, where Editors couldn't see inactive content, even though they had the required permission on a subpath of the portal (e.g. a subsite).
2822b6e
to
b0f302c
Compare
As discussed with @jensens this might need a broader discussion and therefore a PLIP. As a prerequisite, that this change has any effect to editors is, that the editor role gets the
Part of the solution could be to provide an additional parameter to |
While the overall new behavior is correct we have some side effects in existing projects needing some more discussion. So please do NOT merge. |
Ideas to visually mark inactive content in folder_contents:
At some time in the future we might be able to use: https://developer.mozilla.org/de/docs/Web/CSS/text-decoration Not sure, how to explain that to the user. We currently do not have a legend for such visual markings in folder_contents. |
Overall after merging this, the only behavioral change is that editors in local roles are seeing in their section the same as editors in global roles which I think is a good thing. The other problems are still there and we already have them for global roles editors. I propose to fix these problems in a different PR. |
I didn't have time previously to look at this, but I had a look now, and I agree. Thanks for the fix! |
Checked for
AccessInactivePortalContent
for each path in a catalog query.This solves a problem, where Editors couldn't see inactive content, even though they had the required permission on a subpath of the portal (e.g. a subsite).