summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-06-27 16:16:15 +0900
committerShinya Maeda <shinya@gitlab.com>2017-07-05 18:38:25 +0900
commit08ed07cf96be6b988965b14a20397f66a2be9c24 (patch)
treecc24a0c2e7f3bd3918169d1af1ccf996798db6bc /app/policies
parentc1388df040ea18e3d391b10cbab8f67f35d4f641 (diff)
downloadgitlab-ce-08ed07cf96be6b988965b14a20397f66a2be9c24.tar.gz
Improve PipelineSchedulePolicy
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/ci/pipeline_schedule_policy.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/policies/ci/pipeline_schedule_policy.rb b/app/policies/ci/pipeline_schedule_policy.rb
index 2506c179157..9945fec3aaa 100644
--- a/app/policies/ci/pipeline_schedule_policy.rb
+++ b/app/policies/ci/pipeline_schedule_policy.rb
@@ -5,11 +5,15 @@ module Ci
def rules
super
- access = pipeline_schedule.project.team.max_member_access(user.id)
-
- if access == Gitlab::Access::DEVELOPER && pipeline_schedule.owner != user
+ if owned_by_developer? && pipeline_schedule.owner != user
cannot! :update_pipeline_schedule
end
end
+
+ private
+
+ def owned_by_developer?
+ pipeline_schedule.project.team.developer?(user)
+ end
end
end