public static void CheckAccess(object row, Type ret, Type primaryselector)
 {
     if (ret != null && row != null && BqlCommand.GetItemType(primaryselector).IsAssignableFrom(row.GetType()))
     {
         //TOCHECK Possible Perfornance Issue - this will select record for each search result.
         PXGraph graph      = PXGraph.CreateInstance(ret);
         Object  validation = PXSelectorAttribute.Select(graph.GetPrimaryCache(), row, primaryselector.Name);
         if (validation == null)
         {
             throw new PXNotEnoughRightsException(PXCacheRights.Select);
         }
     }
 }