part of a fix to #2716 error in discovery plugin menu and user without provisioning permissions
the other part is a fix to the discovery plugin.