Friday, 18 October 2013

Hiding List Data From Unauthorised Sharepoint Users

We recently implemented a Share Point list for managing IT Purchase requests, and one of the requirements was, understandably, that the person requesting the item could not see all the purchasing information (supplier, quotes etc.) that the office administrator needed to add to the list.

Although you can create different views of a form for submitting and editing a list item, there's no out of the box option for restricting different views of a form or list to different users or groups.
The solution we implemented, which works pretty well, was to create two separate lists and copy the information between the two.

So, in this scenario, we wanted to enable staff to request a quote for additional IT equipment not supplied as part of our standard service offerings (let's say for instance, a 40inch monitor for a meeting room, or a high-end MacBook). Once the quote had been obtained, and the details where entered into the list, an approval workflow would kick in, sending an email to the relevant budget holder and an appropriate person in IT to approve or reject the purchase, and then email the requestor and the person responsible for IT purchasing of the outcome.

End to End Process:
  • The person filling out the form fill in the details of their request and adds a budget holder and recipient for whatever item they are requesting, or marks themselves as the budget holder and/or recipient. Alternatively, if you want force any request to be authorised by someone's manager, you can use the 'find manager' action within the SharePoint Designer workflow to kick of the approval process with them. This depends on your Active Directory being up to date, and also assumes that a budget holder or senior member of staff will never request something for themselves.
  • The recipient and budget holder details are automatically populated with the details of the person filling out the form (see Anne Stenberg's incredibly helpful blog here for instructions on doing this). These fields are hidden from view, unless the person filling out the form chooses selects ‘no’ from the ‘Are you the intended recipient?’ drop down and/or ‘no’ form the ‘Are you authorised to make purchases for your team or department?’ drop down.
  • The recipient is directed to a holding page here once they have completed the form. They also get an email confirming their submission.
  • An email is then generated to the IT Administrator asking them to get a quote from a supplier. The workflow pauses until the ‘supplier’ field has been filled in.
  • Once the quote details have been filled in, an email is sent to the budget holder name on the form.
  • If the budget holder rejects the quote, the process stops there. If the budget holder approves the quote, an email is sent to the Head of IT for approval. If the Head of IT rejects the quote, an email is sent to the budget holder informing them of this, and the process stops there.
  • If the someone within the IT Approvers group approves the quote, an email is sent the budget holder, and another to the IT Administrator telling them to raise a purchase order.

The Setup:
  • Create a list that people will submit their requests to.
  • Create a second list in the same site, with field names and types exactly matching the first list. To this list you can add the additional field that you want to hide from people submitting to the first list.
  • Customise your forms in InfoPath.
  • Create a workflow on the the first list to copy the details across to the second list, and email the person submitting their request to let them know it's been received and is being actioned.
  • Create an approval workflow with the budget holder and the IT Approvers group.
  • Update the list view in SharePoint Designer.

No comments:

Post a Comment