diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-17 22:38:37 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-17 22:38:37 +0800 |
commit | 65e722ee977a3fcd44fb272aa716dfa679385759 (patch) | |
tree | 3fee24a0e09670909df47163fc8d97fb2cc6380d /app/policies/ci | |
parent | 550ccf443059412a26adfcba15fbe9d05d39a5f9 (diff) | |
parent | 05329d4a364a5c55f2de9546871de1909b6be3f5 (diff) | |
download | gitlab-ce-65e722ee977a3fcd44fb272aa716dfa679385759.tar.gz |
Merge remote-tracking branch 'upstream/master' into 30634-protected-pipeline
* upstream/master: (638 commits)
Simplify background migrations stealing code
Expire cached user IDs that can see the performance after 5 minutes
Promote visibility level helpers from Group to Namespace
Fix off-by-one error in background migration retries
Recover from all exceptions when stealing bg migration
Fix label creation from new list for subgroup projects
move click handler to button. when on the icon it wasn't triggered in firefox
Fix incorrect AWS ELB metrics.
Fix wrong link to docs in docs styleguide
Update issue-related docs
Refactor groups docs
Add subgroups limitations to Pages docs
Update Google launcher details
Split docs on IP whitelist for monitoring access
Update health check docs
Bump fog-core to 1.44.3 and fog providers' plugins to latest
Introduce have_gitlab_http_status
Remove Repository#search_files
Update Pipeline's badge count in Merge Request and Commits view to match real-time content
Fixes the user order being overriden in the autocomplete controller
...
Diffstat (limited to 'app/policies/ci')
-rw-r--r-- | app/policies/ci/pipeline_schedule_policy.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/policies/ci/pipeline_schedule_policy.rb b/app/policies/ci/pipeline_schedule_policy.rb index 1877e89bb23..6b7598e1821 100644 --- a/app/policies/ci/pipeline_schedule_policy.rb +++ b/app/policies/ci/pipeline_schedule_policy.rb @@ -1,4 +1,14 @@ module Ci class PipelineSchedulePolicy < PipelinePolicy + alias_method :pipeline_schedule, :subject + + condition(:owner_of_schedule) do + can?(:developer_access) && pipeline_schedule.owned_by?(@user) + end + + rule { can?(:master_access) | owner_of_schedule }.policy do + enable :update_pipeline_schedule + enable :admin_pipeline_schedule + end end end |