cancel
Showing results for 
Search instead for 
Did you mean: 

How to exclude Administrator from Document.GetUsersAndGroups operation ?

pibou_Bouvret
Elite Collaborator
Elite Collaborator

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 ?

1 REPLY 1

pibou_Bouvret
Elite Collaborator
Elite Collaborator

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