Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to set specific permissions to an infopath form if a certain check box is checked. Currently, the form will automatically inherit permissions from the top level site. I want to stop this and assign different permissions to that specific form when the check box is checked. Here is the code I have so far:

        string chkBox = GetNodeValue("/my:myTipLead/my:OBDM/my:DocumentDesignation/my:AllCISOL1And2Members");
        if (chkBox == "AllCISOL1And2Members")
        {

        }
share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

Why not use a workflow to set permissions? It is much simpler than managing that within the code behind of a form.

share|improve this answer
    
Can the workflow detect whether or not the checkbox has been checked? Sometimes this form will be viewed by everyone, other times, when the checkbox is checked, the form can only be viewed by a select few. –  Meyer Denney Apr 12 '11 at 21:19
    
Absolutely, just promote that property to a column from within the form options and then you can reuse it for workflows. –  Lori Apr 12 '11 at 21:23
    
Thank you so much Lori. When I get into work tomorrow morning I will try this out and if it works, select your answer as the correct answer. –  Meyer Denney Apr 12 '11 at 21:48
    
I'm very new to SharePoint. From withing the Sharepoint Designer I have created a custom workflow with the permission settings I want but I am having trouble associating the checkbox property to a column. Do you know how or are there any tutorials out there that could help me out? –  Meyer Denney Apr 14 '11 at 17:20
    
When you go to the Form Options within InfoPath Designer, click on Property Promotion and click Add, find the check box and promote it out to a column name. –  Lori Apr 14 '11 at 20:14
show 2 more comments

Check this blog post for sample code, or this one. You just need adapt one of these and use this code in your code block.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.