From de86867331476a076bee38773222b0533cc03337 Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Mon, 10 Nov 2014 15:27:28 +0100 Subject: [PATCH] Render commit link for users with permissions only --- lib/api/v3/work_packages/form/form_representer.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/api/v3/work_packages/form/form_representer.rb b/lib/api/v3/work_packages/form/form_representer.rb index f2e4992745..27c93a2a34 100644 --- a/lib/api/v3/work_packages/form/form_representer.rb +++ b/lib/api/v3/work_packages/form/form_representer.rb @@ -75,7 +75,8 @@ module API { href: "#{root_path}api/v3/work_packages/#{represented.id}", method: :patch - } if represented.valid? + } if @current_user.allowed_to?(:edit_work_packages, represented.project) && + represented.valid? end property :payload,