Bouncer plug-in problem

hello,

started a new plainkit. first action was to create a role ‘teacher’, which i want to restrict to page ‘kategorien’ and subpages. created

-kategorien
          -kat a
               -sub a
          -kat b
               -sub b

installed bouncer plug-in
config.php

<?php

return [
    'sylvainjule.bouncer.list' => [
        'teacher' => [
            'fieldname' => 'canaccess'
        ]
    ]
];

and teacher.yml

title: Teacher
permissions:
  access:
    panel: true
    site: true
    settings: false
    languages: false
    users: false
  user:
    changeRole: false
    delete: false
    update: false
fields:
  canaccess:
    label: "Zugriff:"
    type: pages
    multiple: false
    options:
      type: query
      query: kirby.page('kategorien').children

in the canaccess field no selection is shown.
yml indentation is correct.
also tried e.g. site.pages, site.find(“kategorien”), site.find(“kategorien”).children… nothing works.

tnx for any hint…
fusi

You have to remove “multiple: false”:

1 Like

The pages field doesn’t have options, it’s just query

  canaccess:
    label: "Zugriff:"
    type: pages
    multiple: false
    query: kirby.page('kategorien').children

However, this query will let you select only a subpage of the kategorien, doesn’t seem to be what you want.

And multiple: false is perfectly fine if you want to select a single page only.

1 Like