getgrav / grav-plugin-login

Grav Login Plugin
http://getgrav.org
MIT License
44 stars 54 forks source link

[Question] How to grant access to a page/subfolder on a restricted folder ? #227

Closed breucker closed 4 years ago

breucker commented 5 years ago

Hi I hope I'm in the right place to ask, forgive me if I'm not...

I try to have a global protected grav instance, at the top level. For that I used the parent_acl set to 'true' on each top level page of my pages directory as suggested in #136. With this configuration, I was wondering if it's possible to allow access to everyone (guest included) for one page or subfolder ? In other words, is there an access permission that would allow access instead of restricting it ? Since the parent_acl configuration searches for parent access rules when there is none, and to my knowledge the only way of allowing access to a page is to not set the "access" frontmatter option, I'm kind of stuck here...

Thanks ! Philippe

mooomooo commented 4 years ago

Any updates to this? I too have the same question. Setting the access frontmatter option to "false" prevents logged in users from accessing the page until they log out.

ricardo118 commented 4 years ago

i dont think there is an option built in, you could go around this with some custom php in a plugin/theme.

in the meantime ill take a look to see if there's some workaround

mooomooo commented 4 years ago

In terms of the workaround -- is there ever a reason to prevent access to logged in users? After all, they are always able to log out and thereby get access. My intuition would suggest that an access value of "false" should allow either logged in or not logged in users to access: it just shouldn't check the login status, not check that the login status equals the access value.

That being said, if there is value in preserving that functionality, then perhaps the access value can take on a tristate value true / false / null, with null representing the case where the login status is not checked, and the two booleans requiring equality.

ricardo118 commented 4 years ago

page access have been greatly modified/improved over grav 1.7, its possible this is already possible but yet undocumented

rhukster commented 4 years ago
---
title: 'Guest Only'
access:
    site.login: false
---

Only if you are guest user