From 8ccf004d12f0a304dbb935af444d37f53c93f5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 11 Mar 2015 12:38:11 +0100 Subject: [PATCH] Bug#2403 Force to only show edit template if the custom-field is editable by the user --- app/coffee/modules/common/custom-field-values.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/coffee/modules/common/custom-field-values.coffee b/app/coffee/modules/common/custom-field-values.coffee index dd3e661b..c827afb8 100644 --- a/app/coffee/modules/common/custom-field-values.coffee +++ b/app/coffee/modules/common/custom-field-values.coffee @@ -128,15 +128,16 @@ CustomAttributeValueDirective = ($template, $selectedText) -> link = ($scope, $el, $attrs, $ctrl) -> render = (attributeValue, edit=false) -> value = attributeValue.value + editable = isEditable() ctx = { id: attributeValue.id name: attributeValue.name description: attributeValue.description value: value - isEditable: isEditable() + isEditable: editable } - if edit or not value + if editable and (edit or not value) html = templateEdit(ctx) else html = template(ctx)