Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Having problems specific page group access, need some help

Started by Japhy 3 years ago · 2 replies · 552 views
3 years ago

I have a site that's behind a login. Using the plugin for that

Within my restricted site I want one page to be accessible for a certain group of users only.

So I created a group (guest) for these users. I added the group to the users. End of yaml files look like this.

TXT
groups:
  - guest
avatar: {  }
hashed_password: removed
access:
  site:
    login: true

But how would that look? Starting point is this

Parent

YAML
access:
    site.login: true
    admin.login: true
login:
    visibility_requires_access: true

The child page in question was

YAML
login:
    visibility_requires_access: true
permissions:
    inherit: true

On the child page I want to only allow group ' guest',

I would expect this to work, but it doesn´t

YAML
login:
    visibility_requires_access: true
access:
    site.login: true
    admin.login: true
    site.guest: true

Everyone has access :(

last edited 06/24/23 by Japhy
3 years ago

Hi @Japhy , take a look at the first part of the post below - I think it's what you need. so,

  1. you need to register a new permission
  2. in group configuration, set Site YourPermission to Allowed
  3. on the Page Security tab, set Page Access

/forum/forms-blueprints/struggling-with-blueprint-custom-header-data-form-in-admin-area-t4637

and also on this topic

3 years ago

Thanks so much @b.da. By reading the posts you mentioned I realized what I was missing. I had not registered a permissions for admin plugin use so I guess I had to add this to the user yaml myself

YAML
access:
  site:
    login: true
    guest: true

And then on the specific page

YAML
login:
    visibility_requires_access: true
access:
    site.guest: true

Suggested topics

Topic Participants Replies Views Activity
General · by Hanns Mattes, 3 weeks ago
1 268 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 196 3 weeks ago
General · by Jerry Hunt, 3 weeks ago
2 332 3 weeks ago
General · by pamtbaau, 3 weeks ago
1 253 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 226 3 weeks ago