Hi,
I’m creating a new site where end-users have to log in and agree to the website terms before they can view the site. In the user blueprint I have a toggle field for agreeing to the terms and a controller for the agreement page which should set the toggle using:
$agreed = get('agreed');
if ($agreed == True) {
$kirby->user()->update([
'terms' => true,
]);
}
When a logged in user ticks a box on the acceptance form and presses submit.
However after pressing submit the debugger shows an error message of:
Kirby\Exception\PermissionException thrown with message "You are not allowed to update the user {user name}
Can anyone help me with this?
Thank you,