Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Trouble getting access to work

Solved by Harald Schneider View solution

Started by Arno Rog 7 years ago · 3 replies · 611 views
7 years ago

I can't get group access to work as expected.
I've user1 member of group1, and user2, member of group2

What is needed in the frontmatter to:
give user1 access to page1, but not not page2
give user2 access to page2, but not not page1

All I've got till now is:

YAML
access:
    site:
        login: true
        group1: true

But both users can see this page.

7 years ago Solution

Example for group1:
This goes into your page's frontmatter:

YAML
access:
    site.group1: true

The corresponding part in user/config/groups.yaml has to look like this:

YAML
group1:
  groupname: group1
  access:
    site:
      login: 'true'
      group1: true
last edited 01/31/20 by Harald Schneider
7 years ago

This was bugging me for some time.
It works great

Can this be incorporated in the excellent Manual?

7 years ago

I second this, too. You are right, the existing manual is misleading at this topic.

Suggested topics

Topic Participants Replies Views Activity
Support · by gravinator, 1 month ago
5 452 1 hour ago
Support · by stell, 7 days ago
4 238 5 days ago
Support · by Gravver, 2 weeks ago
6 279 1 week ago
Support · by Marcel, 4 weeks ago
2 338 1 week ago
Support · by blu3prince, 2 weeks ago
1 254 2 weeks ago