Scenario You have a list which has N number of web parts. You need to hide web few parts based on the user role. How to achieve this? Solution You can use the property Target Audiences of web parts for this. Steps Here are the steps to experiment this feature. Create a new page and add 3 Image Viewer web parts into it. The following are the 3 web parts. 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, then Target Audiences Property to Site Owners, Site Members, Site Viewers groups respectively. Save changes. Now refresh the page. Testing If you are in the Site Owners group, you will see the following web part alone. If you are in the Site Members group, you will see the following web part alone. If you are in the Site Visitors group, you will see the following web part alone. This concludes our example with Target Audiences property. Note: 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 explored the Target Audiences property.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: