BigW Consortium Gitlab

Commit 18c9fc42 by Lin Jen-Shin

Use a block to insert extra check for authenticate_build!

parent a0690c4c
......@@ -14,13 +14,16 @@ module Ci
end
def authenticate_build!(build)
not_found! unless build
forbidden! unless build_token_valid?(build)
validate_build!(build)
validate_build!(build) do
forbidden! unless build_token_valid?(build)
end
end
def validate_build!(build)
not_found! unless build
yield if block_given?
forbidden!('Project has been deleted!') unless build.project
forbidden!('Build has been erased!') if build.erased?
end
......
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