AnsweredAssumed Answered

<runas> for behaviour events?

Question asked by mabayona on Apr 30, 2008
Latest reply on May 10, 2008 by mabayona
I´m using behaviour to implement business logic associated to web client events and I would like to run the associated javascript script with parameter "runas" to avoid permission issues (as per <runas>admin</runas> in workflow actions (in 2.9C_dev)). I´m not sure whether this is implemented or if this is planned.

Does anybody knows how to do it or if this is possible at all?

    <bean id="onCreateNode_DoSomething"
      class="org.alfresco.repo.policy.registration.ClassPolicyRegistration"
      parent="policyRegistration">
      <property name="policyName">
         <value>{http://www.alfresco.org}onCreateNode</value>
      </property>
      <property name="className">
         <value>{my.model}my_type</value>
      </property>
      <property name="behaviour">
         <bean class="org.alfresco.repo.jscript.ScriptBehaviour" parent="scriptBehaviour">
            <property name="notificationFrequency"><value>TRANSACTION_COMMIT</value></property>
            <property name="location">
               <bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
                  <constructor-arg>
                     <value>alfresco/extension/scripts/webclient_events/onCreateNode_DoSomething.js</value>
                  </constructor-arg>
               </bean>
            </property>
         </bean>
      </property>
   </bean>

Outcomes