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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Having problems specific page group access, need some help

Started by Japhy 3 years ago · 2 replies · 487 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 Jerry Hunt, 4 days ago
2 80 10 hours ago
General · by pamtbaau, 15 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago