Extract an allowed_to_delete method

 Please enter the commit message for your changes. Lines starting