changed metadata model to support permissions