The Customer Requirement

When clicking on the SharePoint My Site link initially, the user must be presented with a ‘Terms of Use policy page’ inviting them to read it and click either “Accept” or “Cancel”. Only by clicking ‘Accept’ should they gain access to their My Site home page. Via the User Profile interface, administrators should be able to view these acceptance dates. Administrators will also need continuous permissions to edit the policy document. If alterations are made it should not be necessary for users who have previously accepted to re-accept the document. A link to the Terms of Use policy should be added to the My Site navigation so that it is always available to users.

The Solution - Technical Details

My Sites are a unique type of site within SharePoint 2007 as they are generated by 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. By 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 two separate sites:

A “Personal” site: this is unique to each user, and is 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 and Solutions framework in 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.

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 future My Site customisations. We are putting the necessary plumbing in place enabling 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.

Click here for a downloadable PDF