Route user access from outside and inside network company

I need to construe access of the user from inside and outside the company network.
Ex: User A can access Owncloud from network of my company but can’t access it from outside (as a home network).
Another user - User B can access from outside only.
Can I config my server to do this? (My server Owncloud is a local server)