'Creates a new dashboard.
:<json string name: Dashboard name
Responds with a :ref:`dashboard <dashboard-response-label>`.'

@require_permission('create_dashboard')
def post(self):

    dashboard_properties = request.get_json(force=True)
    dashboard = models.Dashboard(name=dashboard_properties['name'], org=self.current_org, user=self.current_user, is_draft=True, layout='[]')
    models.db.session.add(dashboard)
    models.db.session.commit()
    return dashboard.to_dict()
