Check if user can read HEAD commit when resolving detached HEAD

If HEAD was detached the GetHead REST endpoint refused to resolve HEAD
if the user was no project owner. Instead we are now checking if the
user can actually read this commit and if yes, we return it.

If HEAD points to a non-existing commit we still return the commit
only if the user is a project owner.

Change-Id: I56c49b578516070eb3b02f22677559a0eb11b02e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
1 file changed