How to verify if an user is part of a given group?

Hello,

i am trying to verify if an user is part of a given group. if the user is present the process model continue but if it's not the process stops in this script task.
The variable that saves the result is Boolean.
Why it’s not write the False result?

Regards,
Claudiu

OriginalPostID-226954

OriginalPostID-226954

  Discussion posts and replies are publicly visible

Parents
  • If you are using the function isusermemberofgroup() it may be because you are logged in as a basic user, for which the function is not allowed in the context of.

    From the documentation: "When the expression function is passed a high privacy group as a parameter AND is executed within the context of a basic user who is not a group administrator AND is passed the username of another user, it returns false instead of true.

    A basic user is not allowed to know whether another user is a member of such groups."

    If this is the case, a workaround you could use is calling the 'getdistinctusers()' scripting function to return a list of the users from a passed in group, and then search the returned array/list to see if it contains the user name with the 'contains()' function.

    Hope this was helpful.
Reply
  • If you are using the function isusermemberofgroup() it may be because you are logged in as a basic user, for which the function is not allowed in the context of.

    From the documentation: "When the expression function is passed a high privacy group as a parameter AND is executed within the context of a basic user who is not a group administrator AND is passed the username of another user, it returns false instead of true.

    A basic user is not allowed to know whether another user is a member of such groups."

    If this is the case, a workaround you could use is calling the 'getdistinctusers()' scripting function to return a list of the users from a passed in group, and then search the returned array/list to see if it contains the user name with the 'contains()' function.

    Hope this was helpful.
Children
No Data