Permissions per role
Switch the role and open Insert Gallery. A guest can only pick existing images, a member can upload and create folders, an admin may also rename and delete. The server enforces it: the browser cannot change its role.
The PHP for this demo
$editor->policyFile = match (current_user_role()) {
'admin' => 'admin.config',
'member' => 'default.config',
default => 'guest.config',
};