These are some scripts I use to perform all the tasks a developer wants to do on a Mac that require admin priveliges.
You don't need to give developers enhanced rights and let them break the Mac and your security, use this stuff instead.
More details at https://macintoshguy.wordpress.com/2019/12/03/handling-xcode/