JSON output returns page source code [closed]

My initial thought was correct.

 I thought it might have something to do with not being able to access the
 ajaxurl or so or not having the proper user rights.

I had overlooked a user redirect (which was defined on an incorrect place), hence why I missed it and thus a user got redirected to the correct page since he/she is not allowed in the admin. All I need to do is find a way to create an IF for the admin ajax url.