xpages dynamically change xpage acl? -
i have basic workflow app, , having diffiulty.
in db acl, have people , groups involved set editor. in xpage acl, trying enter computed value name. (a field have called nextapprover, stored on form/document associated xpage.
i've tried
document1.getitemvalue("nextapprover"); and
getcomponent("nextapprover").getvalue(); both create runtime error executing javascript computed expression.
all trying allow nextapprover rights edit document when in "box" , allow rest of users ability read @ particular time. i've looked around while now. suggestions?
you can't access datasource document1 in xpages acl name calculation because acl first calculated , later datasource. that's why javascript runtime error.
here alternative xpages acl:
define datasource document1 action="opendocument"
<xp:this.data> <xp:dominodocument var="document1" action="opendocument" ... /> </xp:this.data> that open document default in read mode.
then switch in beforepageload event edit mode context.setdocumentmode("edit") if current user name in field nextapprover:
<xp:this.beforepageload><![cdata[#{javascript: if (document1.getitemvalue("nextapprover").get(0).equals(session.geteffectiveusername())) { context.setdocumentmode("edit") } }]]></xp:this.beforepageload> you might have change if clause depending on in field nextapprover.
Comments
Post a Comment