In chrome dev tools I can see who I am logged in as and the message "You do not have access..." when I look at operationalLayers[0].errors. Is there an easy way to check for access of the layer besides interpreting the error?
Are you using IdentityManager to authenticate? It has methods to handle this.