Is it possible to allow access to unauthenticated users? Basically, we want a public facing page, but only allow a specific handful of users (or a user role) to be able to EDIT. Everyone else should be able to see the page, but only the specific users/role should be able to EDIT. The documentation, and my testing, indicates that simply checking "Enable page access control" on the page in question will prevent the page from being viewable to the unauthenticated public. I've tried searching for "unauthenticated" in the user field to assign view privileges, but I am not seeing this as an option. Is there something else I should be searching?
If not, would it be possible to add another checkbox for "Unauthenticated User" in the roles section? If so, it also seems that we'd need the ability to give view and/or edit permissions by role. It looks to me now, that if you select a role from the checkbox section, that users in said role have both view AND edit permissions on the node. it would be nice to say these roles can view, these other roles can view and edit, and these specific users can view, and these other specific users can view and edit.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | support_anonymous_role_and_edit_by_role_dropdown_REROLL_1.patch | 14.95 KB | xem8vfdh |
| #4 | support_anonymous_role_and_edit_by_role_dropdown.patch | 11.75 KB | xem8vfdh |
Comments
Comment #2
xem8vfdh commentedHere is a very simple patch (1 line removal and 1 line edit in page_access.module) to allow "Anonymous user" role check box in Roles section, and "Anonymous" user option in users autocomplete box search. This doesn't break the default functionality of the module. Checking the "Enable page access control" box on any node will still default to block anonymous users. However, this gives the admins the rightful power to allow anonymous users to view+edit by role, or view and/or edit by specified "Anonymous" user.
I still think the logic should be split out for the roles section to allow fine grained control over whether a role can or cannot edit, but I haven't looked into that yet.
EDIT: upon further testing, it appears that selecting "Anonymous" from the user dropdown doesn't successfully allow anonymous users to view the node, using the patch above. The "Anonymous user" role checkbox does work. I am not sure what is preventing the user type-in from working, but will look into it.
EDIT 2: Ignore this patch, review the one in comment below.
Comment #3
xem8vfdh commentedI've created a new patch that's a little more robust. It does not allow "anonymous" typed into the user search box, but does allow all the functionality we need via the anonymous role. This patch breaks out the edit permissions by role, so you can enable roles as view only, with the option to also provide edit by role via an additional check box. This patch works in my environment, but I'm wondering if dual role check boxes is the wrong way to go about it. I will look into creating a new patch that uses drop downs instead with options "blocked", "view", "view & edit".
You'd probably want to test this patch on a dev site, or maybe a fresh/new site. If building a new site is too much work, you could drop the records in your page_access table to prevent wonkiness. Maybe there won't be any wonkiness transitioning to the patch, btu I don't have a live environment with PA set up on pages to patch and find out for myself.
EDIT: I think the UI in the patch in the comment below is better, cleaner, and more intuitive. I'd prefer we use that and ignore this one, but feel free to test and provide feedback.
Comment #4
xem8vfdh commentedalright, I think I've got what we want. This new patch is the same functionality as the one above, but with a more intuitive (IMO) UI, where dropdowns are used instead of checkboxes for the role settings. Please review and provide feedback.
Comment #5
xem8vfdh commentedComment #6
xem8vfdh commentedIve gotten an email response from @manojapare that they will be considering the patches. Hopefully we will see an update soon.
Comment #7
xem8vfdh commentedComment #8
hamrant commented@xeM8VfDh please fix drupal coding standards in this patch
Comment #9
xem8vfdh commentedIf the project developers indicate that they have any interest whatsoever in rolling in the feature, I'd be happy to. For the time being, despite this project being labeled as "actively supported", it seems to be dead.
Comment #10
hamrant commented@xeM8VfDh I created a new issue for this - #2867279: Maintainership
Comment #11
xem8vfdh commentedGreat, thanks @hamrant. I will follow that issue and see if anything comes of it. In researching this module more (in comparison to Content Access), I also came across this interesting critique (also related to maintainer-ship): https://www.drupal.org/node/2032001#comment-11969740
Comment #12
rakesh.gectcrBoth of you. Thanks for the patients. Let's get this going. I will update the tests for the module . Then will take these issues. Give me one more week.
Comment #13
xem8vfdh commentedThanks @rakesh.gectcr and @hamrant. It sounds like there may be some security issues that should be addressed before this specific issue. I don't have access to it, but this link was shared elsewhere: https://security.drupal.org/node/161758
Comment #14
xem8vfdh commented@hamrant, I don't think I should re-roll
allow_anonymous_user_and_role.patchandsupport_anonymous_role_and_edit_by_role_checkboxes.patchbecause I think they are the less-than-ideal options. However, I have gone ahead and re-rolled the patch I think we should move forward with (support_anonymous_role_and_edit_by_role_dropdown.patch) to fix some of the Drupal Coding Standard issues I found.See:
support_anonymous_role_and_edit_by_role_dropdown_REROLL_1.patchIf you see any other DCS issues with it, please be explicit. Hopefully you get added as a maintainer and can take it from there if you've tested and like the functionality.
Comment #15
Prince John commentedI think this issue deviates from the scope of this module. The main purpose of the module was to control access (for Roles & Users) for certain pages. If the access has to be given to Unauthenticated Users, then there is no use of this module and thus the public can access the page, which works quite well even without this module.
Comment #16
xem8vfdh commented.
Comment #17
xem8vfdh commentedWhy is an unaffiliated non-maintainer with no post history closing this issue?
I am no longer using or planning to use this module for various reasons. Regardless, @Prince John, you are simply misunderstanding/ignoring an extremely simple and common use case: "Everyone should be able to access this page but only Role X should be able to edit it". This use case requires "View" permission for Anonymous user and "View and Edit" permissions for "Role X".
Unfortunately, it appears that the module maintainers are investing very little effort in this module's issue queue. The "actively maintained" label is a misnomer.
Comment #18
podarokHi all
patch #14 works well
css can't be applied for the 8-x-1.1 but php code works awesome
Thanks a lot for this feature, it improves module's UX really well and covers basic and advanced features.
Can be merged
Comment #19
xem8vfdh commentedthanks for reviewing @podarok!
Comment #20
avpadernoI am closing this issue, since the project isn't supported due to security issues the maintainers didn't fix.