>I need to disable some controls based on roles. If the current user is not a
>member of the group that populates the defined role then the control is set
[quoted text clipped - 9 lines]
>InfoPath roles. What does the get-roles function return and what is the
>recommended operator to handle this?
I have a similar case:
1. Two roles are created: Admins (user1) and Users (user2)
2. A field control is set to be hidden if the current user is not in Admins
role.
3. I published the form to SharePoint Form Library. When I login as user1 or
user2, the InfoPath form behaves correctly.
4. However, when I login as user3, who doesn't belong to Admins nor Users,
the field control now is visible.
Conclude: it seems to me that it is a bug in InfoPath - InfoPath rule engine
didn't know what to do when xdXDocument.getRole() returns nothing (in this
case, can't find the role for specified user).
Please comment.
> No offense, but why are you trying to do this in code?
>
[quoted text clipped - 15 lines]
> >InfoPath roles. What does the get-roles function return and what is the
> >recommended operator to handle this?
devers - 24 Jan 2006 15:01 GMT
I was using the GUI, Renee, I'm just kind of new to InfoPath and I didn't
notice that there are only two operators for the role comparison, equal or
not equal. So no offense taken, my post was less than clear and I'm
appreciative of any information.
What I think I've discovered is that InfoPath seems to evaluate the user's
role for the session. If the users is a member of multiple roles then
whichever it first finds is the role that gets used in evaluating conditional
formatting. I noticed there is an icon in the lower righthand corner of the
InfoPath form that tells you what role the current user is a member of. I
had incorrectly assumed that the conditional formatting would evaluate the
user's role at the control level and consequently it would support users
membership in multiple roles.
This issue is a bit different from Yueli's discovery, but both seem to point
to evaluating Role membership as an area where InfoPath could be improved.

Signature
Dan Evers
> I have a similar case:
>
[quoted text clipped - 31 lines]
> > >InfoPath roles. What does the get-roles function return and what is the
> > >recommended operator to handle this?