2009-04-23

Redirect groups to a specific site or url


I created 2 web parts for aiding the redirection of users to specific area I would like to share with y'all.



  1. Group Page Redirector; this has a group property, a URL and redirect once property.

    If you belong to the selected group it will redirect you to the specified URL. This can be handy if you want to show specific content to a group; like an announcement or terms and conditions. Just add more web parts for other groups.



  2. SubSite Redirector; this doesn't any properties... it just checks which Sub Sites you have access to, and if you only have access to one it will redirect you to it.


They're both simple Web Parts with the source/project code and wsp.

Also you can set them to Minimized and no Chrome, so that they're not visible.



Keywords: Sharepoint Redirect Redirector Web Part once Usage policy ToolPart[]



2009-04-21

Item level permission checking web part


So you want to know what a specific user can and can't see in your SharePoint site?... well for that you'll need to perform an eye examination.


OK really you want to know what items/list/sites for which a specific user has access?
Well believe it or not you can't with the standard SharePoint tools, but it's a fairly simple exercise to create a web part that does, and to save time here's one I made before.




It's fairly simple... get the SPUser > Check what groups he/she belongs to > loop through all the lists > items then the sub sites...

I show an icon for SPBasePermissions instead of the usual Full Control, Contribute, ect. The tree goes down to items, but won't fetch them until you click on the list expand icon to aid performance.
Since I'm using SPUser it also works for forms authentication.
If you don't have permission to check permissions on an object you can set a web part property to show this or not.

In any event the whole project source is included, so feel free to play and recommend changes.


Keywords: Check User Permission Inherited Unique Access RenderPreText RenderPostText TreeNode PeopleEditor SPUser TreeView SPGroup HasUniqueRoleAssignments TreeNodePopulate



2009-04-02

Moving your Windows Installer Directory

I mostly work with Virtual Machines and I like to pre-allocating the disk size. When I created my VM I figured 10GB would be enough for C:\ with Win2003 Server and a couple of SDK's and if I needed more I could always add another drive. I was wrong.

After 2 years my faithful Win2003 dev VM is out of space on C: and I can't shuffle any more files around.

My C:\windows\installer directory is >2GB so this is my prime candidate to move.
Luckily there are always solutions to problems... no I'm not going to delete the directory, or change my registry to point to a new location.

I'm going to add a symbolic link from C:\windows\installer to F:\installer.


  1. Download Junction from http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

  2. Copy OR move C:\windows\installer to F:\installer

  3. Delete all the files in C:\windows\installer

  4. Close all your Explorer windows

  5. Run > cmd> C:\junction C:\WINDOWS\Installer F:\installer
That should do it. I wrote a batch (run.bat) script to do the whole procedure.
@set src=C:\WINDOWS\Installer
@set trg=F:\Installer
::copy %src%\* %trg%
::detele %src%\*
move /y %src%\* %trg%
junction %src% %trg%
pause

This should work for most directories. The batch file should be in the same directory as junction.exe.