Hiya,
I’m running into an issue similar to what’s going on in this thread, where I have a user role that I want to give very specific permissions to.
The permissions themselves are working out great, but even though it’s acting as expected, it’s still throwing out an error saying it didn’t work.
Below, here’s the code I have, in site/roles/bingo.php
…
return [
'name' => 'Bingo',
'permissions' => [
'panel.page.update' => false,
'panel.page.create' => false,
'panel.page.delete' => false,
'panel.page.url' => false,
'panel.page.visibility' => false,
'panel.page.read' => function() {
$check = false;
if($this->target()->page()->slug() === 'gaming'){
$check = true;
} else if($this->target()->page()->slug() === 'bingo') {
$check = true;
}
return $check;
},
'panel.page.update' => function() {
$check = false;
if($this->target()->page()->slug() === 'bingo'){
$check = true;
}
return $check;
},
//'panel.file.update' => false,
//'panel.file.replace' => false,
'panel.file.delete' => false,
'panel.file.upload' => function() {
return $this->target()->page()->slug() === 'bingo';
}
]
];
What I’m trying to do here is allow the user to only view/edit the page called bingo (and since bingo is located inside gaming, I’m allowing the user to see gaming as well)
As I said, this is working great, but when I hit save as a bingo user, I get this dialog…
In addition to that, the page is giving me the dirty layout, with Discard & Save.
@texnixe siad this was a known bug and opened this GitHub issue, but as this is a site I currently have out in production, I’m hoping there’s a way to deal with this problem now, since that issue was opened up in January?
Thanks.