Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Target Audiences of Web Parts

Posted by Paul on August 27, 2015


In this article we can explore the Target Audiences property of web part. This is a less used property.

Scenario

You have a list which has N number of web parts. You need to hide web few parts based on the user role.

image

How to achieve this?

Solution

You can use the property Target Audiences of web parts for this.

Steps

Please follow the steps below to experiment this feature. Create a new page & add 3 Image Viewer web parts into it.

image

Following are the 3 web parts.

image

Now add the above 3 images into Site Assets library and link them to the web parts.

Choose the Web Part > Edit Web Part > Advanced > Target Audiences Property to Site Owners, Site Members, Site Viewers groups respectively.

image

Save changes. Now refresh the page.

Testing

If you are in the Site Owners group, you will see the following web part alone.

image

If you are in the Site Members group, you will see the following web part alone.

image

If you are in the Site Visitors group, you will see the following web part alone.
image

This concludes our example with Target Audiences property.

image

Power Users can use the Edit Page option to roll back the Web Part property. So preferably this method should not be exposed to them.

Summary

In this article we have explored the Target Audiences property.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s