3

I have been looking to wrap security around web parts. I already have security wrapped around documents so only the correct people see the allowed documents. The problem lies when a user does not get to see any documents they have just a header for a web part. Is there any way to hide web parts based on location, security group, or some other form?

1

Maybe setting Target Audience for web part will help you to solve this issue.

1

If You are using System.Web.UI.WebControls.WebParts.WebPart class then You can try with setting this.Hidden = true in Your code when You want to hide the whole Web Part under some conditions

0

You can try webpart audiences, they really annoys me, because hides WP to administrators too, if they are not in audiences groups :o)

http://blog.solanite.com/keith/Lists/Posts/Post.aspx?List=11564265-6153-4557-aee2-72d1f62fa4c1&ID=9

0

Audiences may not be the answer, as it requires you (in case of SP2010) to have the user profile service running. In addition to that, audiences are showed to people who are in that audience. I guess that it's possible that people do belong to an audience, but don't see any documents. If that's not the case (so people who are in an audience, can see the documents) that will be a solution ;)

0

One of the difficulties with Audiences is that the content will load for everyone and only show it to people who are in the audience. If you want true security, and you want to use it on a heavily used page, then I would always show the web part and then put some kind of true security check and only provide output when they have access.

0

I have a couple suggestions.

  1. If you can set permissions on the list instead of the list items, the list view web part will not show for users that do not have permission to the list. I would suggest this method, becuase item level security is hard to manage and maintain.
  2. If you must use item level permissions, you can change the header so it doesn't show for everyone. If you need a header for the people who see documents, you can use SharePoint Designer to modify the XSLT of the List View Web part and show your own header.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.