Required Solution
When a user clicks on their My Site link for the first time they need to be presented with a Terms of Use policy page that requires them to read and then click either “Accept” or “Cancel”. Only upon clicking Accept will they gain access to their My Site home page.
Administrators will need to be able to edit the policy document at any time. Users who have previously clicked Accept will not have to re-accept the document if any changes are made to it. A link to the Terms of Use policy should be added to the My Site navigation so that it is always available to users.
Administrators will be able to view the date that user’s accepted the Terms of Use Policy document through the User Profile interface.
Solution - Technical Details
My Sites are a unique type of site within SharePoint in that they are generated through an automated process. It is particularly difficult to modify this process in order for a custom site definition to be used. Therefore, as it is not feasible to create a custom site definition, we utilise a technique known as Stapling to attach functionality to the existing My Site definition. In using this method all My Sites (created after our solution has been deployed) will include our customisations. This is the best practice approach for applying customisations to My Sites.
It should also be explained that each individual’s My Site is actually made up of 2 separate sites
- A “Personal” site: this is unique to each user, and gets created when they click on the “My Site” link for the first time. It is this site that will be locked down by our implementation.
- A “Host” site: this site is shared by all My Site users. The content displayed within its pages is dynamically generated based on the user in context. It is this site where the Terms of Use page will be placed, thus making it available to all users.
Our solution is built and deployed using the recommended Features & Solutions framework built into SharePoint. Our solution will apply the following customisations to the SharePoint implementation:
- A custom Content Type/Page Layout for the Terms of Use policy page. This will need to be deployed to the “Host” My Site.
- A custom web part/control which renders the Accept and Reject buttons within the policy page depending on whether the user has already accepted. This control also contains the code that updates the user’s “Terms Accepted” date.
- A custom Master Page to be stapled to the My Site definition to house the custom redirect control.
- A custom redirect control that will redirect users to the Terms of Use policy page if they have not previously accepted the terms.
- A custom User Profile field to store the date when the terms were accepted by each user.
- A Feature Receiver which will make the necessary modifications, such as swap out the original Master Page for our custom version and also create the custom User Profile field. Code will also run here that will add a link to the Terms of Use policy within the My Site navigation.
Considerations
Security
Due to the nature of this project there are certain security-related requirements that need to be enforced.
- Users should only be able to accept the Terms of Use policy related to their own My Site. This should be explicitly stated as it is possible to view other users’ My Sites and it is feasible that users could accept the Terms of Use policy on behalf of another user.
The date of acceptance should be logged as part of the User’s Profile. This will allow Administrators to obtain the date of acceptance should this be required.
Summary
We believe that the solution not only delivers the required functionality but also provides a platform for further My Site customisations in the future. We are putting the necessary plumbing in place that will enable in-house developers to build upon our solution to implement extra features such as branding, new web parts and forms.
Our solution is also flexible and allows for the necessary data collection that will provide our customers with the data required in the event that any proceedings need be carried out for misuse of My Sites.
As part of our solution we can offer a handover, walkthrough and full documentation. If you have any questions about any of the above information, or SharePoint development in general please feel free to contact us at the earliest opportunity.