Commit cd38b047 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'nuget-unauthorized-project-message' into 'master'

separate method for unauthorized project messages

See merge request gitlab-org/gitlab!21451
parents 19443331 989ddd2b
......@@ -29,12 +29,16 @@ module API
project = find_project(id)
unless project && can?(current_user, :read_project, project)
return current_user ? not_found! : unauthorized_with_header!
return unauthorized_project_message
end
project
end
def unauthorized_project_message
current_user ? not_found! : unauthorized_with_header!
end
def unauthorized_with_header!
header(AUTHENTICATE_REALM_HEADER, AUTHENTICATE_REALM_NAME)
unauthorized!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment