Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Permission based fields data is reset on save

admin

Started by Aleks 7 years ago · 0 replies · 549 views
7 years ago

I have two users one super-admin and another admin with access to pages.

Super-admin yaml:

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

Admin yaml:

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

In my custom theme I have specified to which tabs each user has access to:

YAML
...
fields:
        advanced:
          security:
            - admin.super

        options:
          security:
            - admin.super

        content:
          security:
            - admin.super

        homepage:
          type: tab
          title: Homepage
          fields:
            header.field1: ...
            header.field2: ...
            header.field3: ...
...

If I login as super admin and add, for example, metadata in the options tab, save it, it will show correctly in the front end. If I now log out and login as admin go to the page and click save it will flush all the data. This ultimately means that I cannot set permissions on tabs because no matter the permission level the data will be reset.

Any idea why is this happening?

last edited 10/28/19 by Aleks

Suggested topics

Topic Participants Replies Views Activity
Plugins · by complanar, 2 weeks ago
2 256 4 days ago
Plugins · by Vladimir Novak, 1 month ago
3 595 1 month ago
Plugins · by Mathieu Lecouturier, 2 months ago
3 417 2 months ago
Plugins · by Slebeig, 2 months ago
1 530 2 months ago
Plugins · by Rene, 3 months ago
2 733 3 months ago