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

Permission based fields data is reset on save

admin

Started by Aleks 7 years ago · 0 replies · 421 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 Rene, 1 week ago
2 80 1 week ago
Plugins · by Xavier, 4 weeks ago
2 84 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1210 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 77 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 103 2 months ago