Jump to content

Cannot View Unpublished Pages


Lauren
 Share

Recommended Posts

Hi there,

I'm new to PW and loving it so far! I'd just like to know... is it possible to have view-only access for unpublished pages?

I can't seem to get that level of permission working without also having to grant EDIT access, which I don't want to do.

Thanks!

Lauren

Link to comment
Share on other sites

I'm guessing you're talking about allowing back-end users the ability to only view unpublished pages, but not be allowed to edit them. I remember wondering about this myself on day one of ProcessWire. Basically, go to the edit view of whatever page you want this view-only behaviour to apply to, then go to the settings tab and in there you'll see under "Status" the option... "Locked: Not editable". Check that, and now the page can be seen but not edited. I think that's what you're looking for.

EDIT: Oh yeah, and furthermore, you'll see the extra "who can access this page" options under there where you can adjust specific user permissions on a page-by-page basis.

Link to comment
Share on other sites

Be aware this makes the page visible for guests as well. I’m not actually sure if what you’re looking for is possible in PW out of the box.

Ah, didn't know that, thanks! But I think the second option "who can access this page" is the solution. You can set up any number of permissions there on a user-by-user, page-by-page basis should you desire.

Link to comment
Share on other sites

  • 1 month later...

Sorry all! I assumed I'd automatically get a notification when there was a reply! Now, I see that I needed to "Follow the topic" :)

Okay. So, here's what I'm looking to accomplish:

Essentially, what I'd like is a "reviewer" Role that I can give to users which allows them to log into the admin, see the Pages list and view any Page, both published and unpublished.

Here's what I've done:

  • Added a new Role called "reviewer" with page-view permission post-2808-0-79104300-1419877727_thumb.pn
  • Under the Access tab, on one of the templates, selected "Yes" to "...manage view and edit access..." and checked the View Pages permission post-2808-0-47360300-1419877728_thumb.pn
  • Created a new user with the "reviewer" role post-2808-0-27489900-1419877901_thumb.pn

When I log in, I don't see any Pages listed:

post-2808-0-26536500-1419877729_thumb.pn

Is there a setting or something I'm missing? I'm wondering if I just haven't fully grasped how the permissions and roles work---I have a sneaking suspicion that's the issue ;)

Link to comment
Share on other sites

Hi Lauren,

In PW a user needs page-edit permission to view the page tree in the admin. Of course you can disable their ability to edit anything using the Access tab on all templates.

I think this will achieve what you are looking for.

Link to comment
Share on other sites

Hi Lauren,

In PW a user needs page-edit permission to view the page tree in the admin. Of course you can disable their ability to edit anything using the Access tab on all templates.

I think this will achieve what you are looking for.

This fixed the issue of not seeing the Pages listed and I can also view the Pages as well. However, I still have the issue of not being able to view Unpublished Pages. They show up in the list, crossed out, like usual. But when I click them, no "view" button is displayed.

Do you mean viewing for unpublished or restricting viewing for published?

(Subtle difference here... :) )

(And I am still enjoying this wonderful Rioja!)

Ah yes. Good question :) Viewing for unpublished pages on the back-end.

I'm guessing you're talking about allowing back-end users the ability to only view unpublished pages, but not be allowed to edit them. I remember wondering about this myself on day one of ProcessWire. Basically, go to the edit view of whatever page you want this view-only behaviour to apply to, then go to the settings tab and in there you'll see under "Status" the option... "Locked: Not editable". Check that, and now the page can be seen but not edited. I think that's what you're looking for.

EDIT: Oh yeah, and furthermore, you'll see the extra "who can access this page" options under there where you can adjust specific user permissions on a page-by-page basis.

Yes, you got it. I tried your suggestion but it didn't make a difference. I do see the unpublished page in the list of pages, but when I click it nothing happens. I would expect a "view" button to appear, like with the other published pages.

Link to comment
Share on other sites

Sounds like a job for ProcessPreview?

I'm really glad you mentioned this module because I have a feeling that the client will probably want that feature at some point! However, it's not quite what I'm looking for.

What I'm looking for is the ability for a user with view-only permission to view unpublished pages that have already been created.

Currently, I'm at the point where unpublished pages do show up in the pages list, which is good. However, no view button is displayed when you click on them, like it does with the other, published pages.

Link to comment
Share on other sites

What I'm looking for is the ability for a user with view-only permission to view unpublished pages that have already been created.

I don't think (not positive) this is actually meant to be possible - I think this is by design - I actually get a message saying "You don't have access to list page X" when I try to click on a page to get the view/edit etc links.

A couple of options for you - neither of which is really what you want, but might be useful :)

The first module should be self-explanatory.

Regarding the second module - the workflow with this would be to publish the page, but protect it (also from the settings tab once the module is installed) - that way the view link will be displayed, but it won't be viewable by any guest user. You would probably also want to set it hidden so that it wouldn't show in the menu / searches etc.

Sorry, neither are ideal for your needs :)

If you want something closer to your original request, then you might need to some fancy hooking, unless I am totally wrong and missing something obvious :)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By JeevanisM
      HI,
      The scenario is,  I manage a magazine website, I have an article to publish, but before making it public available, I have to show the preview to my Editor and get approval. What I have done is, I created the page, filled the contents then put it as a Unpublished status. I as admin can see the preview of the page but when I send this page link to the editor ( he has no admin access, he should not because the person may vary with each articles ) , the editor cannot view the preview of Unpublished page. Is there any workaround on this ?  Is it possible to make this preview page watchable with a direct link ?


      thanks
    • By jonatan
      "Permission “page-sort” for template “ ... ” not allowed (requires “page-edit” permission)"

      – This lovely error message is thrown at me, if, as implied by it, I try to add (to my "editor" role) the permission "page-sort" for a specific template, without the permission "page-edit" enabled for the same template.
      Seems like it's been mentioned a few times before but never properly answered, by e.g. @Robin S ... :  
      "Allow the granting of page-sort permission independent of page-edit": https://github.com/processwire/processwire-requests/issues/29
       
       
       


      Why do I wanna do this?:

      I have a page tree structure  🌳  as so:

      ________________________

      Category [C1]
      – Page a [C1_p] – Page b [C1_p] Different category [C2]
      – Page c [C2_p] – Page d [C2_p] ________________________

      The page "Category" has the page-template "C1",
      the pages "Page a" and "Page b" both have the page-template "C1_p".
      The page "Different category" has the page-template "C2"
      the pages "Page c" and "Page d" both have the page-template "C2_p".
       
      The two pages called "Category" and "Different category" do not have any content, they only serve as containers for pages belonging to that category.
       
      I want my "editor" role not to be able to do anything at all with these pages "Category" and "Different category"; i.e. I do not want my editor to be able to edit, move, unpublish, hide, lock, delete (or do anything else to) these category pages. 
      – So, I want my "editor" role to have the "page-edit" permission for pages with the templates "C1_p" and "C2_p", but not for the pages with the category templates "C1" and "C2",
      Also, I want my "editor" role to be able to move the pages with the templates "C1_p" and "C2_p" within their parent-pages. 


      Problem:

      But if I just simply add the "page-edit" and the "page-move" permissions for the "C1_p" and "C2_p" templates, then, using the "editor" role, I am not able to move these "C1_p" (and "C2_p") -template-based pages. I can actually click "MOVE" next to them and then move them, but... then I will be met by the error message "You do not have permission to sort pages using this parent - /Category/".  
      – So, I try to add the "page-sort" (description: "permission to sort child pages") permission to the "C1" and "C2" templates... but then trying to do so I am met by the initially mentioned error message   ! Permission “page-sort” for template “C1” not allowed (requires “page-edit” permission)  . 
      And, as mentioned, I do not want my editor role users to be able to edit these category ("C1" and "C2") pages...
      – what to do about this? 😅 
       
      All the best,
      Jonatan 
    • By snck
      Hey there,
      for a client website I need to implement a "reviewer" role. "Reviewers" should be able to review new (unpublished) articles to give feedback to editors, but not have the permission to change them. 
      I built a new "reviewer" role that only has page-view permissions for the respective templates, but this permission does not include viewing unpublished pages. How can I grant them access to the unpublished articles without giving them page-edit permission?
      Cheers,
      Flo
    • By snck
      Hey,
      I want my editors to be able to use the page lister, especially the bookmarks. I added the page-lister permission to the editor role, but Page lister ("Find" menu item) does not show. Is there anything else I have to do? Links to bookmarks work for the editors, but I would be glad to show them the menu item as well.
      Maybe this has something to do with the long history of the site (started with ProcessWire 2.4 and upgraded to 3.0.148 over the years)?
      Thanks,
      Flo 
    • By jonatan
      Hi! 😄
      SITE SETUP / DESCRIPTION:
      What? Online art magazine with an "All featured works" and also an "All featured artists" index page, and also individual "Work" and "Artists" pages, and data relations between the different artists and their artworks.
      So, I have two different page reference fields, connected by @Robin S's awesome Connect Page Fields module (though that has nothing to do with the issue in fact, Robin's plugin works great! and the issue is the same with or without it).
      The two Page Reference type fields are called "works" and "artists". They are meant to simply connect different artists to different artworks.
      Fx:
      Work 1  (page)  –> artists (Page Reference field) : Artist A (page)           --->>> (automatically connected)         Artist A (page)  –> works (Page Reference field) : Work 1 (page)
      Work 2  (page) –> artists (Page Reference field) : Artist B  (page)           --->>> (automatically connected)         Artist B (page)  –> works (Page Reference field) : Work 2 (page)
      ISSUE:
      On both Page Reference fields, both on "artists" and on "works" this option "Allow unpublished pages" is activated:

      As it says in the option description, supposedly, unpublished pages should be selectable in the page reference field, but they should not be visible, they shouldn't appear, on the front-end...
      Frontend:
      To show all works related to the artist on the artist individual page I'm doing this:
      <?php foreach($page->works as $item) { echo "<img src='{$item->image->first->width(200)->url}' class='pr-2'><a class='pr-4' href='$item->url'>$item->title</a>"; } The problem is now, unexpectedly, if some work is set to "Unpublished", it shows up anyways!
      WORKAROUND:
      So to get around this I figured out that I can do this:
      <?php foreach($page->works as $item) { if($item->is(Page::statusUnpublished)) { return; }; echo "<img src='{$item->image->first->width(200)->url}' class='pr-2'><a class='pr-4' href='$item->url'>$item->title</a>"; } But ofc this is a rather inelegant "solution" which shouldn't really be necessary, right? 
      I might be missing something basic here, but really can't figure out what it is... I hope one of you awesome guys can help me out 😊
      Thanks a lot in advance!
      All the best,
      Jonatan
×
×
  • Create New...