def get_all_snapshots(self, context, search_opts=None):
    check_policy(context, 'get_all_snapshots')
    search_opts = (search_opts or {})
    if (context.is_admin and ('all_tenants' in search_opts)):
        del search_opts['all_tenants']
        return self.db.snapshot_get_all(context)
    else:
        return self.db.snapshot_get_all_by_project(context, context.project_id)
def get_all_snapshots(self, context, search_opts=None):
    check_policy(context, 'get_all_snapshots')
    search_opts = (search_opts or {})
    if (context.is_admin and ('all_tenants' in search_opts)):
        del search_opts['all_tenants']
        return self.db.snapshot_get_all(context)
    else:
        return self.db.snapshot_get_all_by_project(context, context.project_id)