Can we stop unpublished draft pages showing in space navigation?

Is there any way to stop a previously unpublished page which is saved in draft status from appearing in the {pagetree} e.g. as used in the left hand sidebar of the Documentation theme?

At present when an author adds a new, but as yet unapproved page, readers can see the page link but get an unauthorised access warning message when they try to view the page.

Alternatively, is there any way to change the warning they get to say e.g. something like 'this page is still in draft and will be published soon'?
9 people have
this question
+1
Reply
  • I’m frustrated
    We have the exact same problem! Hope we can get an answer for this as I'm getting spammed by people that think our documentation is broken :(
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • I’m frustrated
    It really places an unnecessary burden on our support department, since we receive numerous emails about pages which are not accessible.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited sad, anxious, confused, frustrated

  • I’m confused
    We have the same problem. Its really annoying.

    It doenst make any sense really.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited sad, anxious, confused, frustrated

  • EMPLOYEE
    I’m concerned
    Oops! Sorry I missed this thread.

    If you are using a Space-wide workflow, you can define a trigger which would make new pages to be restricted to be seen only for the editors, and remove the restriction when the page is approved. e.g.

    {workflow}
    ...
    {trigger:pagecreated}
    {add-restriction:type=View|group=editors-group}
    {trigger}
    {trigger:statechanged|state=Published}
    {remove-restriction:type=View}
    {trigger}
    {workflow}

    But this would work only on new pages.

    To restrict access to existing unapproved pages, you can create a Space Workflow which will traverse of the pages and will add the view restriction to pages which are not in the Published state. e.g.

    {workflow}
    {state:Draft}
    {state}
    {state:Published}
    {state}
    {trigger:labeladded|label=hide}
    {remove-label:hide}
    {set-label:hide|children=true}
    {trigger}
    {trigger:labeladded|label=hide|state=!Published}
    {add-restriction:type=View|group=editors-group}
    {trigger}
    {workflow}


    The workflow will be triggered when adding the hide label to the home page of the space.

    It will take a few minutes if you have too many pages in the space.

    Make sure there is a trigger in the main workflow which will remove the restriction when the page is published.

    We are working on a more elegant solution for setting a default State to all the pages in space.

    Give the solutions above a try and let me know how it goes.

    Roberto
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited sad, anxious, confused, frustrated

  • @rvhof,

    The first triggers will work in 2.0 for sure.

    WRT the workflow to update the existing pages, I am not that sure as I haven't tested it myself on 2.0 either, and I think the second trigger (that checks that the state is not _Published_) will not fire because of a bug, which was fixed in 3.0.

    I think it can work if we change the order of the triggers, i.e.:

    {workflow}
    {state:Draft}
    {state}
    {state:Published}
    {state}
    {trigger:labeladded|label=hide|state=!Published}
    {add-restriction:type=View|group=editors-group}
    {trigger}
    {trigger:labeladded|label=hide}
    {remove-label:hide}
    {set-label:hide|children=true}
    {trigger}
    {workflow}

    I have not tested it in 2.0, but I think it would work.

    WRT to the other states, you should add them to the list, I just include two as it was an example.

    I recommend you to test it first in a dev/test environment, maybe getting a free 10 users license?

    Roberto
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • I am using this kind of trigger and it works great!
    Thank you!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • hi

    I tried this in confluence 4.2.2 and it didn't work . wondering if there was a new way of doing this

    Thanks
    • view 1 more comment
    • Hi

      I re had a look and I think i see my problem

      {add-restriction:type=View|group=editors-group}

      this line limits to the editors group. but the latest workflow uses

      @Reviewers@

      I didn't have a group editors-group !

      Have a bit of a think about this over the weekend i want to change it just slightly..

      so we would have

      anon users
      users with add page rights to the space
      staff members
      reviewers
      editerInChief

      I want to keep using the reviewers and EditorInChief. But i would like staff members to have the right to
      create draft pages and move them to ready state.

      And I would like staff members (or some arbitrary group name), the right to comment on pages that are in draft, or ready state.

      But I would like to hid all pages except from publish from people who are not reviewers / editors / staff members

      can i do this
      {add-restriction:type=View|group=staff-group}
      {add-restriction:type=View|group=reviewers-group}

      is that and'ed together or or'ed ?

      also for people who don't have any rights can I remove the workflow icon.. ie for anon can I removed the publish icon...

      Thanks
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • so does this have to be in a space wide workflow or can it be in a space workflow template? I have put in the required restrictions, but the links are still showing up in activity streams, etc for anonymous users.

    {workflow:name=IT Security Workflow}
    {description}
    Workflow for IT Security
    {description}
    {workflowproperties:chart|rankdir=LR}
    {state:Draft|approved=Ready for QA}
    {approval:Author}
    {state}
    {state:Ready for QA|approved=Ready for SME|rejected=Draft}
    {approval:QA|user=@QA@}
    {state}
    {state:Ready for SME|approved=Ready for Final Review|rejected=Draft}
    {approval:SME|user=@SME@}
    {state}
    {state:Ready for Final Review|approved=Ready to Publish|rejected=Draft}
    {approval:Final Approval|user=@Final Approver@}
    {state}
    {state:Ready to Publish|approved=Published|rejected=Draft}
    {approval:Author}
    {state}
    {state:Published|final=true|rejected=Draft}
    {state}
    {trigger:pagecreated}
    {add-restriction:type=View|user=@Author@}
    {add-restriction:type=View|user=@QA@}
    {add-restriction:type=View|user=@SME@}
    {add-restriction:type=View|user=@Final Approver@}
    {trigger}
    {trigger:statechanged|state=Published}
    {remove-restriction:type=View}
    {trigger}
    {trigger:pageupdated|state=Published}
    {set-state:Draft}
    {add-restriction:type=View|user=@Author@}
    {add-restriction:type=View|user=@QA@}
    {add-restriction:type=View|user=@SME@}
    {add-restriction:type=View|user=@Final Approver@}
    {trigger}
    {workflow}
    • Miguel (Support Engineer) October 03, 2013 05:08
      Hi Julia,

      Pagecreated triggers only work when they are used in space workflows. They don't fire when you add the workflow manually to a page from a template.

      If you are using a single workflow to manage several pages or all pages in a space, we recommend using a space workflow as they have advantages over page workflows.

      Some of the advantages of Space workflows are that they can only be edited by space admins(page workflows can be edited by anyone with edit permissions on the page), they automatically apply to new pages, and also any changed made to the workflow automatically apply to all pages. When you use page workflows by adding templates, to make changes you need to edit the workflow on all the pages it was added to.

      Also - don't add the View restrictions back when the page is edited while in the Published state. If you do that, you will hide the entire page, including the published version.

      If you don't want to use space workflows, remove the {add-restriction} macros from your pageupdated trigger and change
      {trigger:pagecreated}
      to
      {trigger:statechanged|state=Draft}
      and it will work as expected.

      Thanks,
      Miguel
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • Hi Roberto Dominguez ,

    For 3.1.2 version of ad hoc

    1.This is working for me to hide the page and show the error message for pages(other than confluence-administrators).Is it possible to do the same for the blog post?

    {trigger:pagecreated}
    {add-restriction:type=View|group=confluence-administrators}
    {trigger}
    {trigger:statechanged|state=Published}
    {remove-restriction:type=View}
    {trigger}

    2.How to send mail to group of people on new blog post creation(draft) and blog post publish.

    plese revert back soon,we are in urgent requirement.

    Thanks in advance.
    Krish
    • view 3 more comments
    • Miguel (Support Engineer) November 14, 2013 02:36
      Hi Krish,

      For 2a, yes you want to create what is called a "Space Workflow". So if you go to the "Workflows" page in the space admin, find the Workflow template that you want active on all pages in the space and click on the globe icon on the right side. This will make the space workflow active on all current and new pages added to the space.

      As it sounds like you are happy with the content of the existing pages, what you can do is initialize the space to set all the existing pages to a certain state. So in your case, for the workflow you just made a space workflow, click on the green arrow icon, select the "Published" state and click yes. This will set all existing pages to Published.

      For 2b, being that this page is in the space admin, only space admins will be able to edit the workflow.

      Thanks,
      Miguel
    • This comment was removed on 2013-11-14.
      see the change log
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited sad, anxious, confused, frustrated