How can PHP forum administrators prevent losing their admin status when making changes to group permissions?

Issue: PHP forum administrators can prevent losing their admin status when making changes to group permissions by creating a separate role specifically for administrators that cannot be altered by group permission changes. Code snippet:

// Check if user is an administrator before allowing permission changes
if($_SESSION['role'] == 'admin'){
    // Code to change group permissions
} else {
    echo "You do not have permission to change group permissions.";
}