How to prevent members of a certain group from filling out, submitting or even viewing a form? - InfoPath Dev
in

InfoPath Dev

How to prevent members of a certain group from filling out, submitting or even viewing a form?

Last post 04-18-2012 12:47 PM by meyerdenney. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-18-2012 11:44 AM

    How to prevent members of a certain group from filling out, submitting or even viewing a form?

    Lets say I have a few users in a group called "Restricted" and I don't want them to be able to view or submit forms. Should I add some code in the Form_Loading event that checks what groups the current user is a member of? If so, how would I prevent the form from loading? So far the code I have doesn't seem to work. SPGroupCollection grpCol = SPContext.Current.Web.CurrentUser.Groups; try { SPGroup group = grpCol["Restricted"]; // if this doesn't throw an exception, they are not part of that group, so exit return; } catch (Exception ex) { // if exception is thrown, they don't belong to that group, so continue }
    Filed under:
  • 04-18-2012 12:47 PM In reply to

    Re: How to prevent members of a certain group from filling out, submitting or even viewing a form?

    It looks like The standard way for SharePoint to handle this is to call: SPUtility.HandleAccessDenied(new UnauthorizedAccessException()); is what I was looking for
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.