matthiasforberg
Occasional Collector

Workflow Rechte per Skript setzen? Change workflow permissions by script?

Hallo,

in einem Workflow soll abhängig von einer Auswahl jeweils eine andere Benutzergruppe die Freigabeanforderung bekommen. Die Auswahl für die Gruppe kann ich bereits per Workflow-Skript auslesen, aber ich finde keine Möglichkeit, die Rechte zu ändern.

Ich hole mir alle Transitions des Workflows und prüfe, ob diese über Freigaberechte geschaltet werden:

if (trans.useStoreElementRights() && trans.getUsedStoreElementRights() == Permission.CAN_RELEASE) {...}

Wenn das erfüllt ist, möchte ich die jeweilige, im vorigen Schritt ermittelte Benutzergruppe für diese Transition(s) als "FixedRights" setzen. Aber es gibt keine Setter für die Transition.

Ist das irgenwie möglich oder ist die Workflow-API immer noch read-only (wie in 21652 erwähnt)?

Eine andere Möglichkeit wäre noch, für jede Gruppe eine Weiche in den WF einzubauen, was es aber etwas unübersichtlich macht, da es mehrere Schleifen sind, die geändert werden müssten.

Oder Duplizieren des Workflows für jede Freigabegruppe... auch nicht sehr elegant.

Welche Möglichkeiten habe ich, das zu steuern?

Grüße
Matthias

-----

Hello,

In a workflow, different user groups should receive the release request, depending on a selection at the beginning of the Workflow. I can already read the group selection using a workflow script, but I can't find any way to change the rights on the transitions.

I iterate all transitions of the workflow and check whether they are activated via release rights:

if (trans.useStoreElementRights() && trans.getUsedStoreElementRights() == Permission.CAN_RELEASE) {...}

If this is true, I would like to set the particular user group determined in the previous step as "FixedRights" for this transition(s). But there are no setters for the transition.

Is this somehow possible or is the workflow API still read-only (as mentioned in 21652)?

Another possibility would be to install a switch in the WF for each group, but this makes it a bit confusing as there are several loops that would have to be changed.

Or duplicating the workflow for each release group... not very elegant either.

What options do I have to control this?

Greetings
Matthias

0 Kudos
0 Replies