Detecting web UI use pre-receive hook

Preface: We are running GitLab CE (10.8.2). We have created an enforcement policy in the pre-receive hook. The policy is checking the committing user exists within GitLab via an API call, so inactive users are not able to perform commits. However, when logged into the web UI, users are blocked from merging.

Question: Is there a way for us to be able to detect that the web UI has been used to perform the action? As we don’t want to block those users since they have had to authenticate to get into the UI so there is no need for the pre-receive hook to run the enforcement?

Notes: I have discovered that GitHub can do this sort of action with the below:
# If we are on the GitHub Web interface then we don't need to bother to validate the commit user if [[ "${GITHUB_VIA}" == "pull request merge button" ]] || \ [[ "${GITHUB_VIA}" == "blob edit" ]]; then exit 0 fi
Is there something similar that can be done in GitLab?

Kind regards,

I’m interesting in this too! Did you found the answer?

No, I have no answers as of yet.