Check study access rights and study exists. Fix #445
move study access check to user object
pep8 and change to use new user function
merge upload/master
move _has_access to be general function
break out further, test other pages access
fix int problem
merge upstream/master
addressing comments
move access check to Study and update handler
addressing more comments
fix error message
fix merge conflict deletion
flake8
raise error on study not existing
change 500 to 404
fix function argument error
render 404 for 404 errors
proper join for private self-owned study access
use User object for access check