SharePoint 2010 and the GetGroupCollectionFromUser operation in InfoPath - sharepoint

I am working on an InfoPath 2010 form which will be submitted to a SP2010 instance and filled out via a web browser. I am trying to present different views of the form based on the SP User group that the current user belongs to.
On form load I want to check a form status field and check to see if the current user belongs to an approval group. This group is a SP usergroup and from what I can tell the UserGroup.asmx webservice and the GetGroupCollectionFromUser operation is the one I want. However, within InfoPath 2010 after I add the data connection the only result field seems to be userLoginName. This does not seem to be what I want, or if it is, I don't know how to get at the group list contained in that value.
How can I get at the list of SharePoint groups returned?

You need modify the xml schema of the web services:
This post shows how to do it:
http://blog.symprogress.com/2011/05/infopath-list-form-hidedisable-fields-based-on-sharepoint-group-membership/

Related

Custom People Picker is not showing results from SharePoint Group, where users are added using the SPD workflow

I have a custom people picker that fetches users from a SharePoint Group, only when the users are added manually from the Group settings.
If i add the users via SPD Workflow, the people picker is failing to read the data.
Deleted the Users and tried the Workflow, it didnt work. Removed app step from workflow and tried, still no use.
Reference to add User to SPD Group using Workflow: http://codelesssharepointinfopath.com/workflow-useful-rest-calls-add-user-to-group/
Expected: People Picker should show the users from the SPD Group
Actual: No Results found
It's probably because it's a workflow (if you're using 2010 give 2013 a try). Do you get the same issue when you use Flow? If you don't get the same issue I think you need to force a refresh via the workflow. Worst case scenario you can use REST to add the user to the group through the workflow and I would imagine that would force a refresh.

Kentico 9 - How to get assigned role info or name to a document

In Kentico 9 application, assigned different role to specific documents, so that only authorized user can have access of that specific document or page.
There is drop down list showing page list, and need to show only those page which have same access role as logged in user have.
Is there in kentico in built macro available to achieve same or what kentico API could be used to get document assigned role in transformation or grammatically?
If you're using some viewer web part, like repeater, there is a checkbox in web part settings saying check permissions - this will return only documents current user can see.
If you're pulling documents in code behind use document query CheckPermissions method like this:
DocumentHelper.GetDocuments()
.Published()
.Where(where)
.CheckPermissions();

How can an InfoPath form get the Claims of the user who is logged in to SharePoint?

We have a document library that contains a list of proposals (InfoPath Forms). Users log in through SharePoint using Claims (Forms Auth, via an Extranet) who are from various organizations. The forms open in InfoPath on the client. The InfoPath form contains a field for what organization the proposal belongs to (a select list) that the user then selects when filling the form.
We have written a custom claims provider that augments each user's login with an organization claim.
When the user opens a proposal from SharePoint in the InfoPath form filler, we'd like to:
Pre-populate the organization select list with the organization
matching the user's claim
Restrict the saving of the form (inserting and updating) if the
user's claim value for organization does not match the selected
organization on the form
I'm wondering how to get the claims information in InfoPath. Or, for ideas on how to do this server-side using a custom workflow/event receiver/web service (or something else).
Here is a basic tutorial for getting claims from SharePoint 2010. Place this in the code behind of your InfoPath form. http://msdn.microsoft.com/en-us/library/ee535731.aspx
Ideally you want to call the code from the FormEvents_Loading method of your InfoPath form and if the user's organization is invalid, create a bool, that if false, will prevent the form from submitting. This would be done in the FormEvents_Submit method.
I'm not sure if this works for your specific implementation however, you can set the data source for input controls (drop down lists, list boxes, etc) to be retreived from a web service.
You can then use hidden fields on the eForm which are populated with the metadata you need such as the user Id. These values are subsequently passed to the webservice and the return (List or whatever) are bound to the desired controls within the eForm.

Can SharePoint's Select People and Groups dialog box's Title and Department fields be customized with a custom membership provider?

I have created a custom membership provider for a SharePoint application but would like to populate the Title and Department columns for the MembershipUsers that are displayed with data from my user repository.
Is this possible? How can it be done?
I don't see anything in the System.Web.Security.MembershipUser class that could store this information. How does the Windows AD MembershipProvider have a different Display Name than the Account Name? Are some of these values coming from someplace else?
What happens in the AD is that, SharePoint runs the User Profile Sync Job that will pull all the required information from AD and updated the SharePoint UserProfile DB which In turn pushes to Each of the Site. Whereas in the case of the Custom Membership we don't have a direct option to update the Profile Information.
One method you can do is to update those information using code.There are two options you can update the User Profile information in the SSP so that it will be displayed in all the Site Collection or to Update the SPWeb.SiteUserInfo List. Please refer these link1 , link2 on how to do that. In case you want to update in SiteUserInfo list it is just another list just search for Item based on the user account name and update that item.

SharePoint Registration Form - How to Hide Fields

I created a basic registration form using a SharePoint 2007 custom list where users complete fields on the form. I created an 'Approver' field that I'm trying to hide from customers so that only the form's approver will edit that field (approve the request - Customers tend to approve their own request). How can I hide this approval field so it can be edited by the approver only?
Attempted Solutions:
1. I set the content type for that approval column to 'hidden'. How would I access the URL to the hidden approval field so the approver can access the field and update it for that specific item? The hidden field is not visible if I click 'Edit Item'. Did I miss something with the hidden content type so that I would see the column on the edit page?
2. I customized newform.aspx in designer by removing the hidden approval field and it worked. But 'Attach File' doesn't work when the new form is customized. It spews out an errors.
Any suggestions?
Have a look at the SPListDisplaySettings component from codeplex. Adding this solution will allow you to specify how to show the fields in display, new and edit mode based on SharePoint users and groups.
May be create a custom field control (how?) that will check the current users role agains the site before choosing to display the field.
This is pretty hard core customisation compared to creating lists though.
Why not just use the Approval workflow with this list? Users would be able to create approval requests, which would automatically trigger the Approval workflow, which would create a task and send an e-mail for the approver to approve the request. Once it's approved - the status of the request would change to approved. The approver can also add a comment on the approval form, if needed.

Resources