gitlab-org--gitlab-foss/app/policies/ci/build_policy.rb
Lin Jen-Shin 39573c6dde Merge remote-tracking branch 'upstream/master' into 30634-protected-pipeline
* upstream/master: (119 commits)
  Speed up operations performed by gitlab-shell
  Change the force flag to a keyword argument
  add image - issue boards - moving card
  copyedit == ee !2296
  Reset @full_path to nil when cache expires
  Replace existing runner links with icons and tooltips, move into btn-group.
  add margin between captcha and register button
  Eagerly create a milestone that is used in a feature spec
  Adjust readme repo width
  Resolve "Issue Board -> "Remove from board" button when viewing an issue gives js error and fails"
  Set force_remove_source_branch default to false.
  Fix rubocop offenses
  Make entrypoint and command keys to be array of strings
  Add issuable-list class to shared mr/issue lists to fix new responsive layout
  New navigation breadcrumbs
  Restore timeago translations in renderTimeago.
  Fix curl example paths (missing the 'files' segment)
  Automatically hide sidebar on smaller screens
  Fix typo in IssuesFinder comment
  Make Project#ensure_repository force create a repo
  ...
2017-07-04 05:15:27 +08:00

11 lines
289 B
Ruby

module Ci
class BuildPolicy < CommitStatusPolicy
condition(:user_cannot_update) do
!::Gitlab::UserAccess
.new(@user, project: @subject.project)
.can_push_or_merge_to_branch?(@subject.ref)
end
rule { user_cannot_update }.prevent :update_build
end
end