User roles do not appear to be working - InfoPath Dev
in

InfoPath Dev

User roles do not appear to be working

Last post 10-23-2007 03:01 AM by adamrharding. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 10-17-2007 11:54 PM

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    User roles do not appear to be working

    Hello,

     I have a form setup and I have tried to setup different roles for different views.  Infopath 2003

    Open form rules 

    Default rule, opens to New Entry View (this is the default and initiator rule/view) 

    Then I have a returning user role which is set to an NT group containing all of our NT users.  When a user is a member of this group, it should switch to the "returning user" view (if user current role = reutrning user role switch view to "returning user" view,

    I also have a role setup which specifies an NT group containing the IT admins.  When an IT admin opens the form, it should switch to the it admin view )if user role - "IT admins" switch the view to IT Admin view ((if user current role = ITadmin role switch view to "IT Admin" view,)

     No matter what, I seem to be getting the default view.  I have disabled all but the one role rule so that the only one I had active was the default user role and the returning user role.  The only way I could get it to switch to the returning use role was to set the rule to "not equal". 

    This makes me believe that it is not reading the NT group because the user is certainly a member.

    I can look up users and I was able to view all of the AD groups while in design mode. 

    Help, thank you

  • 10-19-2007 02:18 AM In reply to

    Re: User roles do not appear to be working

    Typically I would use some expression boxes to do some debugging.  I am not sure that the role membership has been calculated yet when the open rules are being triggered but I would add some expression boxes to see what the values are as your open rules are being executed to verify.

    If you need an Active Directory web service, there is one included in the Database Accelerator download which I know is available in Open Rules.Qdabra Database Accelerator Suite Version 2.1 - Developer

    Filed under:
  • 10-19-2007 08:41 AM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    Ok, forgive me, I'm not very advance with this...  What type of expression boxes and what would they do?

     - Chris

  • 10-19-2007 08:49 AM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    And if it didnt check the roles when you opened the form, what would be the purpose of the roles?

     

  • 10-19-2007 09:04 AM In reply to

    Re: User roles do not appear to be working

    Hey Chris.

    Expression boxes are an action type where you can pop an alert box with a value or formula.  This is often nice for debuging if you are only developing in InfoPath since you can order them to see the values before and after the actions you are trying to implement.

    I am not real familiar with roles but they may not get checked before the open rules are fired. They may get checked next.  They are typically used to filter content and not to show different views.  I think the standard design is you have one view and then use roles to specify what each role sees from the view.

    I have used both SharePoint and the Active Directory web service to identify a form user by a data connection, which complete before the Open Rules. Then based on the form user or their group membership I can put in the logic to route them to specific views. That was what I was referring to.

  • 10-19-2007 09:35 AM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    I am using instructions provided by MSDN, and the open form rules says to check the users role and switch views based on that criteria.

     http://msdn2.microsoft.com/en-us/library/ms788207.aspx

     Ok, I will keep playing with it.  I can't see why it is not working at this point. 

     How would I use the AD Web service to identify a form user?  I've tried doing this with control sections as well but I have the same problem, which makes me think it is not reading the users roles at all.

    Thansk for the assistance by the way, I do appreciate it.  I'm just baffled, not arguing... 

    - chris

  • 10-19-2007 09:46 AM In reply to

    Re: User roles do not appear to be working

    Yes I think the best explanation is that you are not getting any role information.

    That was where I was thinking you could try and prove this by displaying the information.

    The AD webservice is pretty simple. Install it on a box with IIS.  Then you just setup a receive web service data connection which will give you either the username or you can get a true false on membership to a specific group. Which is probably what you are looking for. Then you can just use the logic off of the true or false value.

    Qdabra Database Accelerator Suite Version 2.1.2815 - Developer with this you get the webservice plus a bunch of other web services.

    You can purchase the AD webservice by itself here. http://www.qdabra.com/en/products/ADWebService.aspx

     

  • 10-19-2007 03:23 PM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    Ok, Installed, the demo.  I'm just not sure how to setup the data connection to read it...

  • 10-19-2007 03:50 PM In reply to

    Re: User roles do not appear to be working

    Ok well I would look at these tutorials.

  • AD Service: How-To Set Field to GetMyInfo Result
  • AD Service: How-To Query GetUserInfo
  • I think the best method is take a blank form. Add the web service three times for each of the methods.  Then drag the repeating groups and fields on to your form and some buttons to query each and then play with it in preview.

    Test putting in different query values and seeing what is returned.

    Then you should be able to figure out exactly what you need for your form solution.

    You could either create a data connection for each group you need to check or run the query, process the result and then change the group query parameter and run it again.

  • 10-20-2007 02:29 AM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    I found the docs.  Thank you.  I will be testing it this weekend.  Thanks again!

     

     

  • 10-20-2007 07:21 PM In reply to

    Re: User roles do not appear to be working

    Hi Chris,

    The AD Web service functionality will provide more information from Active Directory, but you don't need the AD Web service to switch views based on AD group. Here are a couple ideas for why you might have experienced the problem mentioned in your first few posts:

    1. Did you set the default user as initiator? If you did, new forms will get that role. Have you tried opening existing forms - do they get set to other user roles (note: you probably already know to look in lower right corner of status bar for the role info)
    2. Did you make sure that the open rules stopped being applied after the first user role match? If you have several rules, it's possible that a user belongs to multiple groups, or it's possible that the last rule always succeeds. You should check the box to stop processing rules when one of the rules succeeds since that will switch to the correct view.

    Good luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 10-22-2007 09:42 PM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    Patrick Halstead:
    Did you set the default user as initiator? If you did, new forms will get that role. Have you tried opening existing forms - do they get set to other user roles (note: you probably already know to look in lower right corner of status bar for the role info)

      Actually, I did not know that.  I have basically removed all of my opening rules except for 2 that should not have any effect on the views and added only one to change views if you are in the admin group.  No matter what, my form is opening with the initiator view using that role.

    Patrick Halstead:
    Did you make sure that the open rules stopped being applied after the first user role match? If you have several rules, it's possible that a user belongs to multiple groups, or it's possible that the last rule always succeeds. You should check the box to stop processing rules when one of the rules succeeds since that will switch to the correct view.
    Yes, I did have them set to stop processing which is why I figured it was not reading my group memberships.

    On the other note.  I did try out the example button in the download documentation.  It did return a lot of information, but I'm not sure what to do with it.  I must have been using the wrong webservice, but I have not yet figure out how to make it determine my group membership. 

    I'm working both fronts at this point...

  • 10-22-2007 10:21 PM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    caw01:
    Did you set the default user as initiator?

    Just making sure I didnt miss something in the terminology....  "default user"?  Here's what I did.  I created a rule that is associated with an AD group and made it the default/initiator rule.  The AD group is kind of like an all users group. 

     Then I have a view that is specified as the default view. 

    I have a second rule that is associated with the nt\administrators group.  Then on the Form properties I have an Open and Save rule that says if the "users role" = "nt administrators role" ACTION switch views to Admin View.

    when I open a new form it opens to the new entry view user role.  After I save it, and then reopen it, it is still opening it up to the same view.  I am an admin, so it should open to the admin view.

  • 10-22-2007 10:31 PM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    caw01:
    I created a rule

    Sorry, late night...  That is ROLE...
  • 10-22-2007 11:44 PM In reply to

    • caw01
    • Not Ranked
    • Joined on 10-18-2007
    • Posts 13

    Re: User roles do not appear to be working

    Ok, in typing that previous message I started to get to where I needed to be.  I changed my default initiator rule so that it was not associated with a group..  That wasnt the fix, but seems to be working ok now.

     The actual fix was a rule that had the stop processing box checked.  So it was changing a field value and then stopping.  So it did end up having an effect on my roles after all.

Page 1 of 2 (17 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.