disable infoPath field based on sharepoint list value

I have a list in SharePoint 2013 called "Managers"  that has the names of users.

I also have an infoPath form that has a few fields.  On the form, there are certain fields that only the manager can have access to. I would  those fields to be enabled only for the manager.  It should be disabled for everybody else.

Any ideas?

IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

melli111SharePoint Administrator / DeveloperCommented:
On the fields that you wish to disable, you need to add conditional formatting.  You'll go into Manage Rules, new, formatting.  Then you'll write your condition.  Your condition would be something along the lines of if currentuser does not equal managerusername(any occurrence) then disable this control.  This is assuming you already have a receive data connection to access the managers list.  If you need more detailed steps please let me know.
1. Create SharePoint hosted WCF service returning Security Group name of the current user
2. In InfoPath create data connection to this service
3. For the selected field within InfoPath implement conditional formatting (control disabling). As a data source select the one described in the previous step. Ensure the field is enabled only for the Owner Group users.
IsaacSharePoint Client Side DeveloperAuthor Commented:

There is no currentuser in the drop down of the condition
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

Is the InfoPath form on the Managers list?
IsaacSharePoint Client Side DeveloperAuthor Commented:
What do you mean?
melli111SharePoint Administrator / DeveloperCommented:
Add a field to your form for currentUser.  Then set its default value to formula of currentuser().  Then you can use this field in the condition

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.