Ey,yay is just a wrapper for pacman. If running pacman tells you that it has a permission issue, you should run the commands as root, e.g. by prefixing them with sudo. All pacman commands should also work on yay as long as you replace "pacman" with "yay". Generally, in the Arch wiki, all lines prefixed with # mean that you should run the command as root.
-- Cheers, Aᴀʀᴏɴ
OpenPGP_0x4E85967FC7C436BE.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature