tag:blogger.com,1999:blog-7258322562721325894.post1175636091941205854..comments2023-08-17T13:27:47.119+03:00Comments on How To Code: MOSS: How to hide UI elements according to user's AudienceJussi Palohttp://www.blogger.com/profile/00392327346825133905noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7258322562721325894.post-71936053488911972102013-12-07T17:29:33.205+02:002013-12-07T17:29:33.205+02:00Thanks for this solution! It is a great addition t...Thanks for this solution! It is a great addition to use with custom UI Elements. To answer the use with multiple SharePoint Groups instead of Audiences question, you can use this solution with some modifications to how you add it on a page to achieve this. SharePoint Groups can be used as an Audience without compiling an actual Audience in Central Admin. So with this solution all you have to do is set a Register Tagprefix for the solution on the page or MasterPage you need to use it on. Then for the Tag around your object, set it with your Tagprefix and a unique ID (unique ID if you want to use this feature more than once on a page). You can then set an AudienceString with multiple SharePoint Groups separated with a comma....like..... Group1,Group2,Group3,Group4. Works like a charm. I would actually post the code so it’s more obvious, but your blog won't allow code postings. I could try to post on my own blog with a reference to this post so it’s clearer, if you would like see what I mean. Just let me know.Austins Inkspothttp://www.austinsinkspot.comnoreply@blogger.comtag:blogger.com,1999:blog-7258322562721325894.post-27570876879626576652010-05-10T12:17:01.957+03:002010-05-10T12:17:01.957+03:00If you want to target specific web parts, you can ...If you want to target specific web parts, you can just use the Audience functionality of a web part. Otherwise you can use SPWeb.IsCurrentUserMemberOfGroup(int groupId), or SPGroup.ContainsCurrentUser. Current SPWeb's associated groups (Member, Visitor, Owner) you can get using SPWeb.AssociatedGroups, or SPWeb.AssociatedMember/Owner/VisitorGroup.Jussi Palohttps://www.blogger.com/profile/04625491599540982394noreply@blogger.comtag:blogger.com,1999:blog-7258322562721325894.post-32765773175182807852010-05-06T21:36:08.884+03:002010-05-06T21:36:08.884+03:00Need help please. How can i make this work with my...Need help please. How can i make this work with mytple sp-groups instead of audiences.Anonymousnoreply@blogger.com