added permission/role check to database metadata access
added permission/role check to database metadata access