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 · 504 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 Vladimir Novak, 2 weeks ago
3 295 2 weeks ago
Plugins · by Mathieu Lecouturier, 3 weeks ago
3 277 3 weeks ago
Plugins · by Slebeig, 2 months ago
1 403 2 months ago
Plugins · by Rene, 2 months ago
2 574 2 months ago
Plugins · by Xavier, 3 months ago
2 490 3 months ago