Commit 359c039b authored by Douwe Maan's avatar Douwe Maan

Fix Git access check.

parent fdcf8732
...@@ -102,9 +102,8 @@ module Gitlab ...@@ -102,9 +102,8 @@ module Gitlab
end end
def user_push_access_check(changes) def user_push_access_check(changes)
if ::License.block_changes? unless user && user_allowed?
message = ::LicenseHelper.license_message(signed_in: true, is_admin: (user && user.is_admin?)) return build_status_object(false, "You don't have access")
return build_status_object(false, message)
end end
if changes.blank? if changes.blank?
...@@ -115,6 +114,11 @@ module Gitlab ...@@ -115,6 +114,11 @@ module Gitlab
return build_status_object(false, "Repository does not exist") return build_status_object(false, "Repository does not exist")
end end
if ::License.block_changes?
message = ::LicenseHelper.license_message(signed_in: true, is_admin: (user && user.is_admin?))
return build_status_object(false, message)
end
changes = changes.lines if changes.kind_of?(String) changes = changes.lines if changes.kind_of?(String)
# Iterate over all changes to find if user allowed all of them to be applied # Iterate over all changes to find if user allowed all of them to be applied
......
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