Bug#2403 Force to only show edit template if the custom-field is editable by the user
parent
4c89984dfa
commit
8ccf004d12
|
@ -128,15 +128,16 @@ CustomAttributeValueDirective = ($template, $selectedText) ->
|
||||||
link = ($scope, $el, $attrs, $ctrl) ->
|
link = ($scope, $el, $attrs, $ctrl) ->
|
||||||
render = (attributeValue, edit=false) ->
|
render = (attributeValue, edit=false) ->
|
||||||
value = attributeValue.value
|
value = attributeValue.value
|
||||||
|
editable = isEditable()
|
||||||
ctx = {
|
ctx = {
|
||||||
id: attributeValue.id
|
id: attributeValue.id
|
||||||
name: attributeValue.name
|
name: attributeValue.name
|
||||||
description: attributeValue.description
|
description: attributeValue.description
|
||||||
value: value
|
value: value
|
||||||
isEditable: isEditable()
|
isEditable: editable
|
||||||
}
|
}
|
||||||
|
|
||||||
if edit or not value
|
if editable and (edit or not value)
|
||||||
html = templateEdit(ctx)
|
html = templateEdit(ctx)
|
||||||
else
|
else
|
||||||
html = template(ctx)
|
html = template(ctx)
|
||||||
|
|
Loading…
Reference in New Issue