part of a fix to #2716 error in discovery plugin menu and user without p...

...rovisioning permissions

the other part is a fix to the discovery plugin.