cancel
Showing results for 
Search instead for 
Did you mean: 

<runas> for behaviour events?

mabayona
Champ on-the-rise
Champ on-the-rise
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>
2 REPLIES 2

pmonks
Star Contributor
Star Contributor
I don't believe this is possible yet, but this has been requested in other contexts (eg. for Web Scripts - see ALFCOM-1473 http://issues.alfresco.com/browse/ALFCOM-1473).

I'd encourage you to raise a new JIRA ticket for this specific use case ("runas" for any Javascript script) and cross reference it here so that we can all vote / comment / track it.

Thanks!
Peter

mabayona
Champ on-the-rise
Champ on-the-rise