kirby-bouncer icon indicating copy to clipboard operation
kirby-bouncer copied to clipboard

Added 'extra-allowed' array to config

Open Greakz opened this issue 11 months ago • 3 comments

I added an extra configuration option to the plugin. With that, the list of allowed-pages can be extended in the kirby configuration to allow the creation of areas in other plugins.

An example config now looks like:

'sylvainjule.bouncer' => [
        'list'=> [
            '<role>' => [
                'fieldname' => 'canaccess'
            ],
        ],
        'extra-allowed' => [
            [
                'title' => 'Area Title',
                'path'  => '/area-path'
            ]
        ]
    ]

Greakz avatar Mar 15 '24 14:03 Greakz

Nice, exactly what I needed just now. Is there a way to include all subpages of a path as well?

animaux avatar Mar 28 '24 11:03 animaux

Nice, exactly what I needed just now. Is there a way to include all subpages of a path as well?

I think there is currently no way for allowing all subpages of a given path as well. As you can see in lib/bouncer.php (Around Line 19) all child pages are added to the list of allowed pages and in index.php (Line 38) the check will look for an exact match in the array of allowed paths. In order to allow subpages, this check have to be changed.

Greakz avatar Apr 02 '24 06:04 Greakz

@Greakz thanks for pointing out the logic behind this. I guess it should be fine if it’s not too much subpages.

animaux avatar Apr 04 '24 21:04 animaux