<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to test if a user can start a process start</title><link>https://answers.axonivy.com/questions/768/how-to-test-if-a-user-can-start-a-process-start</link><description>&lt;p&gt;I have an IUSER Object and IProcessStart, how can i test, if user is able to start this process start ?&lt;/p&gt;
&lt;p&gt;(i have no session of user, so i can't test it like 
ivy.session.getStartableProcessStarts()  )&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/768/how-to-test-if-a-user-can-start-a-process-start" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 10 Jun 2014 15:38:26 -0400</lastBuildDate><item><title>Comment by Karel Tauser on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/768/how-to-test-if-a-user-can-start-a-process-start#773</link><description>&lt;p&gt;that's what I need, thx ;-)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Karel Tauser</dc:creator><pubDate>Tue, 10 Jun 2014 15:38:26 -0400</pubDate><guid>https://answers.axonivy.com/questions/768/how-to-test-if-a-user-can-start-a-process-start#773</guid></item><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/768/how-to-test-if-a-user-can-start-a-process-start/771</link><description>&lt;p&gt;A IProcessStart may be up casted to a IStartElement. The IStartElement has a getActivator() method where the Role or User that is allowed to start the process is returned. &lt;/p&gt;
&lt;p&gt;Use the following code to check if a user can start the process:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import ch.ivyteam.ivy.security.IUser;
import ch.ivyteam.ivy.workflow.IProcessStart;
import ch.ivyteam.ivy.workflow.IStartElement;
IProcessStart processStart;
IUser user = ivy.session.getSessionUser();

if (processStart instanceof IStartElement)
{
    IStartElement startElement = processStart as IStartElement;

    // with user
    startElement.getActivator().isMember(user.getUserToken(), false);

    // with session
    startElement.getActivator().isMember(ivy.session, false);
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Tue, 10 Jun 2014 15:22:12 -0400</pubDate><guid>https://answers.axonivy.com/questions/768/how-to-test-if-a-user-can-start-a-process-start/771</guid></item></channel></rss>