Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system. code example
Example: homebrew permission
sudo chown -R $(whoami) $(brew --prefix)/*