Skip to content
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

Published object with effective date in the future is not shown in folder_contents view #3571

Open
1letter opened this issue Jun 30, 2022 · 19 comments · May be fixed by #4042
Open

Published object with effective date in the future is not shown in folder_contents view #3571

1letter opened this issue Jun 30, 2022 · 19 comments · May be fixed by #4042

Comments

@1letter
Copy link
Contributor

1letter commented Jun 30, 2022

go to https://demo-latest-plone6.plone.org/

  1. login as editor in chief
  2. add a folder
  3. publish the folder
  4. add a page with effective date in the future
  5. publish the page
  6. go to the parent folder_contents view

the table is empty!

what i expect: the page that i added with a label "in the future"

@petschki
Copy link
Member

petschki commented Jul 1, 2022

long time ago, but this sounds like a regression: #1952

@petschki
Copy link
Member

petschki commented Jul 1, 2022

If I'm the owner, I also expect that the page is visible regardless of the workflow state.

@petschki
Copy link
Member

petschki commented Jul 1, 2022

After some more investigations: not a regression but "hard to implement" ... as @davisagli already mentioned here https://community.plone.org/t/published-object-with-effective-date-in-the-future-is-not-shown-in-folder-contents-view/15410/2, the portal and a given path keyword in the query is checked for AccessInactivePortalContent ...

But I really would like to pull in more ideas to get this done (maybe) ...

I could think of an enhancement of the AllowedRolesAndUsers index to respect the Access inactive portal content permission too, instead of setting the effectiveRange ... but that's just a quick thought ...

@thet as you've implemented the check in the CatalogTool maybe you have some more thoughts on this?

/cc @jensens @pbauer

@1letter
Copy link
Contributor Author

1letter commented Jul 1, 2022

referring to the old discussions, i look in the code. it's hard to find a solution without wake up the full objects in the search result. i think it needs 3 parts to correctness:

  1. for the folder_contents View a query paramter show_inactive=True is needed
  2. the permissions of the state "private" in simple_publication_workflow should be changed, private mean "Owner" & "Manager" can view, access or edit - no others
  3. a published item with an effective date in the future is published... other editors can view this item. for me is the "effective date in future" no security related, it's only a display feature for anonymous or members. all other roles can view this item.

@petschki
Copy link
Member

petschki commented Jul 1, 2022

show_inactive=True for folder_contents sounds like a good idea.

@yurj
Copy link
Contributor

yurj commented Jul 1, 2022

If the problem is only on the foldercontent view, I would fix it there instead of the catalog filtering. In a normal view (folderlisting/contentlisting) it is ok to not show the object even if I'm the owner, because it is inactive/expired (*). If the pat-structure can query the catalog in an unrestricted mode, that could be the solution? anyway, it depends on the context, so an adapter that adapt on the foldercontent view (and reuse most of the logic) could be the way?

(*) is inactive only when expired or there are other cases?

@petschki
Copy link
Member

petschki commented Jul 1, 2022

(*) is inactive only when expired or there are other cases?

the check for AccessInactivePortalContent simply sets the effectiveRange index to today if not allowed ... so the range between effective_date and expiration_date is filtered.
My first idea with the AllowedRolesAndUsers index cannot work as this is set on creation/modification but the effectiveRange depends on the current datetime of course.

Solving this in folder_contents would be ok for me as @yurj suggests ... but I would set a show_inactive parameter in the data-pat-structure configuration and pass it to the @@getVocabulary view.

@1letter
Copy link
Contributor Author

1letter commented Jul 1, 2022

@petschki where can i set this option? it's a rebuild of the js bundle needed? or exist an adapter like for tinymce to modify the pattern settings?

@petschki
Copy link
Member

petschki commented Jul 1, 2022

I think these 3 parts are needed:

  • pat-structure needs the parameter in its defaults (=mockup rebuild)
  • plone.app.content.browser.contents has to set the parameter in FolderContentsView.get_options
  • plone.app.content.browser.vocbulary should pass the parameter to plone.app.vocabularies.catalog correctly

@1letter
Copy link
Contributor Author

1letter commented May 15, 2023

The behavior is fixed on https://classic.demo.plone.org it is not reproducible, can this closed?

@davisagli
Copy link
Member

Note: it's still an issue in Volto, but there is a fix here: plone/volto#4764

@MrTango
Copy link
Contributor

MrTango commented Oct 28, 2024

@1letter i still see the same issue in classic ui in Plone 6.12
You ave to be a non-admin user to see the effect i think ;)

@1letter
Copy link
Contributor Author

1letter commented Oct 28, 2024

@MrTango okay, you're partly right. as editor in chief, all is fine. but as normal editor the issue exists

@1letter 1letter reopened this Oct 28, 2024
@yurj
Copy link
Contributor

yurj commented Oct 29, 2024

I've solved in a site assigning "Show inactive portal content" permission to the Editor role at portal level. Do you see any drawback? The question is: what was the use case when Editor should not see inactive portal content? We should document (@stevepiercy ) what the roles are supposed to mean before any code changing.

@stevepiercy
Copy link
Contributor

Before I document anything, I need to know the roles, the object, and the permissions each role may perform on that object.

@yurj
Copy link
Contributor

yurj commented Oct 29, 2024

We need something like this https://5.docs.plone.org/working-with-content/collaboration-and-workflow/workflow-policies.html

Actually we've https://training.plone.org/workflow/roles-and-permissions.html which is pretty good IMHO.

Maybe we could add as an example the role "Content Manager" that has Contributor + Editor + Reviewer + Reader + has "view inactive content" permission that basically can go anywhere and change/publish/create content.

Then we've Site Admin which is a Content Manager but can also access the Site configurations. Finally, we've the Manager that can do everything.

@stevepiercy
Copy link
Contributor

I'm fine with whatever y'all think is best.

We need to determine the audience. It sounds like a User Guide item, and not a Developer Guide item. Right now the Classic UI User Guide does not exist for Plone 6, but I hope that will change soon, once we can find a way to automate screenshots and videos. We also have an open PR to create a Developer Guide.

@davisagli
Copy link
Member

Granting the "Show inactive portal content" permission to the Editor role at the portal level is probably fine and should help with this in cases where the Editor role is granted to users or groups for the entire site. For users who only have the Editor role in a subsite or folder, the permission won't be there when the catalog is queried in the context of the entire site.

@MrTango
Copy link
Contributor

MrTango commented Nov 4, 2024

@stevepiercy there is nothing to document, this needs to be fixed in core.
@petschki and i looked into it, I'll make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants