Page()->blueprint() ? Set panel lang for user?

Hi Kirby fellas,

Here I come with 2 questions regarding permissions and roles that I am currently fine tuning.

First question, let me put some context:

I have a hidden page Technologies that store the list of technologies my company works on. I use this hidden sub-pages on several other pages. This page has its own blueprint technologies.yml but no template technologies.php as I don’t need one because the page will never be displayed as is.

In my roles I want to authorize my translator team to read and update this page but of course this:

$this->target()->page()->template() === 'technologies';

does not work as technologies uses the default template. But I don’t want to allow this:

$this->target()->page()->template() === 'default';

as I have a few pages (backups, for instance) that use the default template and I don’t want to allow read on these ones.

Any idea on how to work with this situation ? A kind of $this->target()->page()->blueprint() === 'technologies' maybe ?


My second question is also dedicated to my translators. For now, I use this to manage translators’ rights:

'panel.page.update' => function() {
   return $this->site()->language() == 'cn';
},

Is it possible to go further and set panel language to the one I want for a specific role ? I’m looking for a way to avoid my chinese / french translators to log in on en english panel by default. It’s simple to switch but, you know…

Many thanks in advance !

The intendedTemplate() method is what you want.

I don’t think you can set a default language on a per role basis… at least I couldn’t find any option in the docs. I created a feature request on GitHub.

Hi Texnixe,

indeed, intendedTemplate() is what I need.

And thank you for the feature request, I think it could be a great feature to ease the panel for lambda users. The dropdown language selector is not that easy to understand for them.