Are there any potential security risks associated with deleting uploaded files in PHP?

When deleting uploaded files in PHP, one potential security risk is the possibility of allowing unauthorized users to delete files from the server. To mitigate this risk, it is important to validate the user's permissions before allowing the deletion of any files.

// Check user permissions before deleting the file
if($user->isAdmin()) {
    $file_path = 'uploads/' . $_POST['file_name'];

    if(file_exists($file_path)) {
        unlink($file_path);
        echo 'File deleted successfully.';
    } else {
        echo 'File not found.';
    }
} else {
    echo 'Unauthorized to delete files.';
}