diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-06-28 15:42:13 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-07-05 12:36:19 +0300 |
commit | e1ba0058118d7717d0f14e8b39f90fde5ed80907 (patch) | |
tree | f6923287dfbf536e5f5f665363f41f33e6de1ea0 /app/policies/ci | |
parent | 8889bb63f79f020ac9fbe2ba15dc9bc1909a4a69 (diff) |
zh nich catches 2
Diffstat (limited to 'app/policies/ci')
-rw-r--r-- | app/policies/ci/pipeline_schedule_policy.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/policies/ci/pipeline_schedule_policy.rb b/app/policies/ci/pipeline_schedule_policy.rb index 9945fec3aaa..0e26b6e688a 100644 --- a/app/policies/ci/pipeline_schedule_policy.rb +++ b/app/policies/ci/pipeline_schedule_policy.rb @@ -5,7 +5,7 @@ module Ci def rules super - if owned_by_developer? && pipeline_schedule.owner != user + if owned_by_developer? && owned_by_another? cannot! :update_pipeline_schedule end end @@ -15,5 +15,9 @@ module Ci def owned_by_developer? pipeline_schedule.project.team.developer?(user) end + + def owned_by_another? + !pipeline_schedule.owned_by?(user) + end end end |