Jump to content

new user role can't publish...must be missing something.


evan
 Share

Recommended Posts

Hello,

Somehow I can't seem to get a new user role to publish new pages -- only create and save unpublished.

I created a new role called "editor" with view, edit, delete, and move permissions. I also allowed access management on the appropriate template. Still nothing. What am I missing?

I'm using PW 2.2.

Knowing how this goes, I'll probably figure this out in a second or two...!

Tempting fate,

-e.

Link to comment
Share on other sites

http://processwire.c...__fromsearch__1

Have you tried really and added it to the template access settings too?

Edit:

Upps, that isn't really the issue I think.

I just tried in my local install latest PW and no problem with publishing pages even without the page-publish permission.

Edit: The page-publish permission is only if you want to hide it...

So maybe you haven't checked it, take a look if you have access setting enabled in your PW template.

Link to comment
Share on other sites

Well, nothing changes on the template access side...it still just shows the view, edit, create, and add children options. Should there be another option? Do I need to do anything more than add a "page-publish" item in the permissions settings, and select it in the appropriate role?

Link to comment
Share on other sites

WOw I should first think then write :D

I didn't test correctly I didn't logout and login with editor... mmm

I will try again an see.

Edit:

Ok this is getting messy, it's so odd I can't even describe it.

I added page-publish permission, and tried different settings. First time I try the editor could only edit the one unpublished page an all others only view... and when trying to edit the page I got.

Duplicate entry 'for-page-1010-1070' for key 'name_parent_id'

So trying to find a reason, I looked at the settings on page with superuser, and published and unpublished - and it showed me different permission for the editor role, in each state.

After that I removed the page-publish permisson, and now the editor can edit all pages again, although the error stays and won't go away...

So I don't know if my install is messed up after all those tests and updates. I would have to reinstall a fresh one and test again to see.

Link to comment
Share on other sites

Another weird thing is that I've tried enabling all the permissions on this particular role -- which is the same as superuser, correct? -- and it still doesn't let me publish.

I double-checked that user's role is correct, so it ain't that kind of mistake....must be some other dumb thing I'm missing!

Link to comment
Share on other sites

I just reinstalled a fresh and latest PW.

And I have just added a editor role with view edit delete permissions. Gave access right (all) on template basic-page for editor role. After that when creating a new page I can't publish it, only save and keep unpublished.

There seems to be something wrong with current access system. Ryan? :D

Link to comment
Share on other sites

OK, I think I figured it out, but I don't understand why it worked. On the template I had specified a single children template, and I removed it. Now the user's able to publish. But I tried adding the single template option again to see if it would disallow publishing again, and it still allowed the user to publish. Maybe it had something to do with the "change template" permission, and when I added the role? Very weird!

Nevermind! Forgot I had the superuser role assigned.

At least I know this issue is repeatable and I didn't just miss something.

Link to comment
Share on other sites

Yeah, I wasn't able to get the editor publish unpublished pages. Although I managed to get some strange behaviors, when I remove the page-publish permission from the editor role I suddenly can't even edit pages anymore except for the unpublished ones, for example...

I think only Ryan would know what's going on. Certainly a bug or alike.

Link to comment
Share on other sites

I think I might have this problem too.

When you say its fixed in the latest commit, do you mean that I need to download Processwire from Github and replace my install as if i'm upgrading?

Link to comment
Share on other sites

When you say its fixed in the latest commit, do you mean that I need to download Processwire from Github and replace my install as if i'm upgrading?

If your not using git, yes.

only the wire folder though

  • Like 1
Link to comment
Share on other sites

Anyway to roll out a new update soon?

I don't know how to use Git and I've tried to manually edit these but my PW 2.2 doenst have the same lines in wire/modules/PagePermissions.module as I've searched for those lines to edit them.

I'm having problems letting users create new pages and I think its related to this. I'm about to launch a site soon and just noticed this today as I had to setup some permissions. Not sure I have time to test the PW with the repeatable field stuff in it yet.

Sorry I found out the setting under "add children" wasnt checked on some items.

Link to comment
Share on other sites

You can just go to github download the zip file (button top left) https://github.com/r...ramerdesign/P21, nothing special. And then rename the wire folder in your install to "wire_old" and copy the new wire from the zip over. Repeaters aren't installed by default so it should be no problem. If you experience any problems you can roll back to the old wire folder. Also may report the issue you got in case.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Sorry guys--looks like a bug, thanks for finding it. Just fixed this in the latest commit. When you get a chance, please confirm that it fixes it on your end too.

I just tested the page-publish permission, and I got same the still odd behavior as described in this thread. With latest dev version of PW.

I added a "page-publish" permission to a role "publisher", the editor that has this role added can't edit pages anymore, only for unpublished pages. Once you go to the a page with access roles of editor and publisher set, and look at the settings for "Who can access this page?" when you publish and unpublish the page you'll see strange things happening to the roles and their permissions. Has this fix ever been comited or was it once in and left out on dev branch?

Edit: Ok tested this little further. It seems I'm not able to stack the roles for publish permission. Like having a editor role without publish permission, and a publisher role that has only "page-publish" and "page-view" permission. 

editor1

  guest, editor, publisher

editor2

  guest, editor

with this setup I can't get it to work and get strange things happen.

It works when I separate the two roles with publish permission and give publisher also same rights plus "page-publish" like

editor1

   guest, publisher (edit and publish)

editor2

   guest, editor (only edit not publish)

Isn't it mean to combine roles like adding roles with certain permissions?

Another thing when testing this, was that when I give a role edit, delete etc permissions - and then on the template I check all permissions for that role (as the checkboxes are enabled).

So far so good. But when I remove the edit, delete permissions from that role after that, the setting are still somehow existent on the template access and role settings, but the checkboxes are disabled. Still yet it shows these permission for that role when inspecting a page under "Who can access this page?".

Not sure what's about that, but pretty confusing. When I turn back on the permission for that role, the checkboxes are again enabled AND all checked. Shouldn't when removing permissions from a role also those settings getting removed? Those setting somehow remain hidden but still active? It's maybe a detail but maybe would explain why I seen strange things happening. Even though it's maybe not important, but I found it confusing when testing with roles and permission.

Link to comment
Share on other sites

I added a "page-publish" permission to a role "publisher", the editor that has this role added can't edit pages anymore, only for unpublished pages. Once you go to the a page with access roles of editor and publisher set, and look at the settings for "Who can access this page?" when you publish and unpublish the page you'll see strange things happening to the roles and their permissions. Has this fix ever been comited or was it once in and left out on dev branch?

Once a system has a page-publish permission, it changes the behavior of page-edit as well. From that point forward, a user with page-edit permission must also have page-publish permission in order to edit a published page. 

The "who can access this page?" screen is telling you as much as it can about individual roles, but it's not telling you anything about combinations of roles. If a page is published, and there is a role that has page-edit, but not page-publish, then it's going to say it's not editable by that role. And that's true, because if you take that role by itself, the page isn't editable. Likewise, if you've got a role with page-publish, but not page-edit, a user with that role by itself can't edit anything. So this information section can't tell you anything about what might be the results of combining roles. Since that is determined at runtime, specific to a user, the only way you can tell is to try it with an actual user. Before I experiment too much here, I should check if you are testing by logging in as the user, or just by looking at what this info screen says? 

Ok tested this little further. It seems I'm not able to stack the roles for publish permission. Like having a editor role without publish permission, and a publisher role that has only "page-publish" and "page-view" permission. 

Stacked permissions should still work for the actual user at runtime. Though let me know if you find they aren't?

So far so good. But when I remove the edit, delete permissions from that role after that, the setting are still somehow existent on the template access and role settings, but the checkboxes are disabled. Still yet it shows these permission for that role when inspecting a page under "Who can access this page?".

These settings are cached with the template. So it may say one thing here based on that cached state, but again the runtime result of the actual permissions for a user should be consistent with the user's actual permissions. Let me know if you find it is not, as that would be a bug. 

Not sure what's about that, but pretty confusing. When I turn back on the permission for that role, the checkboxes are again enabled AND all checked. Shouldn't when removing permissions from a role also those settings getting removed? Those setting somehow remain hidden but still active? It's maybe a detail but maybe would explain why I seen strange things happening. Even though it's maybe not important, but I found it confusing when testing with roles and permission.

 I agree this must look confusing. Those checkboxes are getting populated with the cached value from the template. It sounds like what I need to do here is prevent "disabled" attribute checkboxes from having a checked value.

Link to comment
Share on other sites

 I agree this must look confusing. Those checkboxes are getting populated with the cached value from the template. It sounds like what I need to do here is prevent "disabled" attribute checkboxes from having a checked value.

I can't seem to duplicate this one. I give a role page-edit permission, go edit a template, on the access tab check all the boxes for that role and save. Then I go back and edit the role and remove edit permission. When I go back to the template access tab, no boxes are checked except for 'view'. So it looks like what I thought was a problem with cached permissions there isn't actually an issue. But I'm guessing I'm going about the wrong way in trying to duplicate it? Please let me know what steps to take and I'll try again.

Link to comment
Share on other sites

Just pushed some updates (dev) to the output of "who can access this page" on the PageEdit screen. Not sure I've got it perfect yet, but found a couple issues there related to what you mentioned and fixed them. 

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

×
×
  • Create New...