How to exclude Administrator from Document.GetUsersAndGroups operation ?

Following the “One step validation workflow tutorial”, i created a custom permission and i'm using it to retrieve the users for a Workflow.CreateTask operation. Everything is working fine, except the “everything” permission being given to administrators includes my custom permission, so that a task is created for administrators.

How can i get rid of the administrators in the user list ?

0 votes

1 answers

2003 views

ANSWER



Did it with RunScript :

assigned = Document.GetUsersAndGroups(“my_permission”)

name_administrators = Document.GetUsersAndGroups(“Everything”)

foreach ( name_administrator : Context["name_administrators"]) 
{
    if( Context["assigned"].indexOf(name_administrator) >= 0 )
    {
        Context["assigned"].remove(Context["assigned"].indexOf(name_administrator));
    } 
}
0 votes