You can edit user permissions in the Server/app/Services/UserService.php
file.
protected $permissions = [
"global" => ["profile:update", "image:create", "image:delete"],
"customRole" => ["examle:create", "example:update"],
"manager" => ["example:delete"],
];
$user->addGroup("customRole");
$user->removeGroup("customRole");
if ($user->can("example:delete"))
{
// This users has the required permissions to perform this action.
}