'Disable anonymous access to a dashboard.
:param dashboard_id: The numeric ID of the dashboard to unshare.'

def delete(self, dashboard_id):

    dashboard = models.Dashboard.get_by_id_and_org(dashboard_id, self.current_org)
    require_admin_or_owner(dashboard.user_id)
    api_key = models.ApiKey.get_by_object(dashboard)
    if api_key:
        api_key.active = False
        models.db.session.add(api_key)
        models.db.session.commit()
    self.record_event({'action': 'deactivate_api_key', 'object_id': dashboard.id, 'object_type': 'dashboard'})
