Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Permission based fields data is reset on save

admin

Started by Aleks 7 years ago · 0 replies · 651 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 DrPen, 1 month ago
2 478 1 month ago
Plugins · by renedebaaij, 2 months ago
1 351 1 month ago
Plugins · by Thomas, 1 month ago
1 375 1 month ago
Plugins · by complanar, 2 months ago
6 699 2 months ago
Plugins · by BenLaKnet, 2 months ago
1 643 2 months ago