Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

hide web part

  Asked By: Juan    Date: Sep 09    Category: Sharepoint    Views: 1237

i need to hide a web part, in the home dashboard, from some users among who
there's a workspace coordinator. what i do is going to the portal folder and
set the deny permission to the webpart.htm file for the above users.
Everything works fine but for the coordinator, who still see the web part
(no surprise at all, I know that a coordinator has special permissions).
What shall I do to hide the web part from that coordinator?



3 Answers Found

Answer #1    Answered By: Paola Mcmahon     Answered On: Sep 09

There was a presentation on Best Practices at MEC. It was suggested that
hiding a web  part by using permissions  was not a great way to go. They
suggested to modify the web part  code to set the isincluded to false
when you want to hide  the web part. You can create a function that does
something like If the user is Bob then isincluded = false. The syntax
to set the isincluded should be evident if you look at a web part. I
don't have one available right now but you basically ask for th node by
name and then set its value based on if you want to include it.

Answer #2    Answered By: Justin Mckee     Answered On: Sep 09

I believe the best practices said that if you use permissions  to hide  a web
part, the page actually still incurs the load hit for the part, it's just
not viewable.

You can use vbscript to grab the nt username and base restricitons as Darrin
has suggest (or another language if it is an external web  part)

Syntax that I have used for vbscript is:

set wshShell = CreateObject("WScript.Shell")
strUser = wshShell.ExpandEnvironmentStrings("%USERNAME%")

Answer #3    Answered By: Jared Bell     Answered On: Sep 09

Another issue is caching. If the dashboard  or definition is cached and
I am the first to view as coordinator, everyone after me, until the
cache expires will see the web  part.

Didn't find what you were looking for? Find more on hide web part Or get search suggestion and latest updates.