Setting permissions for which networks an app can access New to this forum, not sure if this is a duplicate.

Is there a way to restrict which networks an app can use? For example, I don't want to use a location-based dating app (or similar , e.g. Snapchat) on my work/university/school network. I would prefer those apps to only access the internet from my home network (private) or cellular data (again private). This is to avoid legal issues, etc.

I've set network settings to "restrict background usage" and also restricted networks. But as far as I can tell, this only stops apps from accessing the internet in the background. 

I'm using lollypop on a Samsung in case that makes a difference.

How should I go about restricting the particular networks (WiFi, cellular) that an app can access? Is there an app I need? Do I need to root?

Apologies again if this is a duplicate.
You can try NetGuard - no-root firewall to block internet access for apps selectively (forbid an app access to WiFi or cellular data). It works without Root as name suggests. It's available from Google PlayStore as well as from F-Droid.
You can use it to disable particular apps from accessing internet while you're connected to your work/university/school network.