I have an IUSER Object and IProcessStart, how can i test, if user is able to start this process start ?

(i have no session of user, so i can't test it like ivy.session.getStartableProcessStarts() )

asked 10.06.2014 at 14:37

Karel%20Tauser's gravatar image

Karel Tauser
(suspended)
accept rate: 0%


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.

Use the following code to check if a user can start the process:

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);
}
link

answered 10.06.2014 at 15:22

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

that's what I need, thx ;-)

(10.06.2014 at 15:38) Karel Tauser Karel%20Tauser's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×37

Asked: 10.06.2014 at 14:37

Seen: 2,150 times

Last updated: 10.06.2014 at 15:38