The [edit] link in showWikiText is shown even while mayEdit returns false(text.getEntity) returns false


access control rules

rule ajaxtemplate editableText(text : Ref) {
true
}
rule ajaxtemplate showWikiText(text : Ref) {
mayView(text.getEntity())
rule action edit() { mayEdit(text.getEntity()) }
}
rule ajaxtemplate editWikiText(text : Ref) {
mayEdit(text.getEntity())
}

section editable text

define ajax editableText(text : Ref) {
placeholder showText{ showWikiText(text) }
}

define ajax showWikiText(text : Ref) {
action edit(){ replace(showText, editWikiText(text)); }
container[class:=“showWikiTextEdit”]{ submitlink edit() { “[edit]” } }
output(text)
}

Submitted by Eelco Visser on 5 January 2011 at 21:15

Log in to post comments