You can check for permissions in twig by using the snippet below.
But, how do we know what the value for the
hasPermission() function should be?
The easiest way is to navigate to the admin permissions page, and inspect the checkbox for the permission you’d like to check for. Within there, you’ll see a
name attribute that has the information you’re looking for.