Added restriction for dashboards and metrics #2:)

Please, find my comment to commit.
I have already test it and add some instructions for you.
Same as above: use the ORM to query the database, be specific about the exceptions you're expecting.