In these cases, you can think what voices are the most important. First of all, the soprano line (because it is very often the most melodically developed voice) can't be sacrified. Play it legato but if you can't find an appropriate fingering for the lower voice or voices in the right hand, you can sometimes play them with detached articulation. Be careful, though that your articulation doesn't draw attention to these voices.
If you have more than two voices in the left hand, I think the lowest voice becomes the vital part here. Try to play it legato and if you must, the upper voices can be detached.
Because the bass part is the foundation of the harmony, try to play it legato at all times (when the style requires it).
Sometimes I hear some organists play the pedal part with detached articulation while the upper parts are performed legato. Often this is due to poor choice of pedaling. Try to work out the pedaling so that the result would be a smooth legato. Employ both feet (toe and heel) when you have to.
Please note that the above tips apply only when the general performance style is legato (for Romantic and Modern music). But even then there are certain cases, when some notes should not be played legato (you can read about it here). Because in early music we use the articulate legato touch, these tips for the most part don't really matter for Medieval, Renaissance, Baroque and Classical organ music.