code: func SearchDashboardSnapshots(query *m.GetDashboardSnapshotsQuery) error {
  	var snapshots = make(m.DashboardSnapshotsList, 0)
  
  	sess := x.Limit(query.Limit)
  	sess.Table("dashboard_snapshot")
  
  	if query.Name != "" {
  		sess.Where("name LIKE ?", query.Name)
  	}
  
  	// admins can see all snapshots, everyone else can only see their own snapshots
  	if query.SignedInUser.OrgRole == m.ROLE_ADMIN {
  		sess.Where("org_id = ?", query.OrgId)
  	} else if !query.SignedInUser.IsAnonymous {
  		sess.Where("org_id = ? AND user_id = ?", query.OrgId, query.SignedInUser.UserId)
  	} else {
  		query.Result = snapshots
  		return nil
  	}
  
  	err := sess.Find(&snapshots)
  	query.Result = snapshots
  	return err
  }
docs: // SearchDashboardSnapshots returns a list of all snapshots for admins
  // for other roles, it returns snapshots created by the user