The size of this makes me think we should create an Authorization module for Errata and add a readable function to encapsulate this permission logic.