Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

Roles and conditional formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
devers - 17 Jan 2006 02:29 GMT
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
to read only.  The roles are defined with Active Directory groups and a user
may be in mutiple groups and consequently be a member of multiple roles.  

When I compare the current user to a role I have been using equals as the
operator but it doesn't seem to be working.  My first fear was that the role
was a snapshot of the group members when I defined the role in my InfoPath
form, but that seems unlikely, after all this is a Microsoft product so you'd
think it was dynamic.  So now I am wondering if maybe the opertor should be
something else to handle the case of membership in multiple AD groups and
InfoPath roles.  What does the get-roles function return and what is the
recommended operator to handle this?  
Signature

Dan Evers

renee rieser - 19 Jan 2006 08:43 GMT
No offense, but why are you trying to do this in code?

The logical and proper place to do this is in the GUI. Check out the
Display properties box for whatever controls or section or whatever
that you're trying to make read-only.

>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?  
Yueli Du - 23 Jan 2006 22:55 GMT
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?  
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.