Change the check for authority with hasAuthority instead of catching an
exception. Thanks @DavyLandman.