Critical currents in granular superconductors