Your Very Own Permissions Dashboard

For SharePoint 2007:

Using a web service and a little magic, it’s possible to create your own data view web part “dashboard” to quickly get to permissions and other screens for all of the lists and libraries on your SharePoint site.  Here’s an example of what the goal is:

permsdash

The first column is the title of each list and library on the site, linking directly to each list or library.  The Inherited Security column does two things.  First of all, it displays an icon to indicate whether that list inherits permissions from the site level or not.  Secondly, each of these icons is a link directly to the permissions page for that specific list or library!  The third column is a bonus.  For the lists that have their own separate permissions, there is a link to directly add a new user to have permissions on that list.

Okay, okay, I’ll tell you how!

This post is really an expansion on a previous post of mine, called I Love the SiteData.asmx Web Service.  First step: Go to that post and go all the way through step 14.  We’ll pick up from there…

columns

This is what you have so far.  It’s a list of all the lists and libraries on the site, with the inherited security and internal name.

  • Now, the title of the library needs to be a link to the library itself.  Click to select the title of the first document library.  Click the little chevron next to it.
  • In the Format As field, select Hyperlink.  Click Yes at the prompt.
  • Clear the Address field, and click the Function box next to it.  Chose the DefaultViewURL field.  Clear the Text To Display box, and choose the Title field for that one.   Click OK.
    edithyperlink
  • For the icons in the inherited security column, you’ll need two pretty little icons of your choosing, to indicate Yes or No.  If you have MOSS, the icons in this example are already right there on the server, and are called /_layouts/images/ewr212l.gif and /_layouts/images/ewr213l.gif.  Anyway, for the next step, put your cursor inside one of the cells in the Inherited Security column, and insert BOTH of these images, right next to each other.
  • Click the Data View menu at the top of the screen and choose <Conditional Formatting>.  Then the conditional formatting pane will be displayed on the right side of the screen.
  • Let’s create the hyperlink on each icon before we set the conditional formatting.

The fun part!  The first question is, where the heck does the URL come from, to get straight to a library’s permissions page?  Go to one of your libraries, and click to get to the settings page, and then click on “Permissions for this list”.  Go to the browser’s address bar, and select that entire URL, copy it to your clipboard, and paste in notepad.  It’s time to dissect it to see how it works.  Here’s what my URL looks like:

https://sharepoint.company.com/sitename/_layouts/user.aspx?obj=%7B458828DD%2D7951%2D4FB6%2DA151%2D4CF8B36D863A%7D,list&List=%7B458828DD%2D7951%2D4FB6%2DA151%2D4CF8B36D863A%7D

What the heck is all that? Calm down, it’s okay, it’s just the GUID.  Yeah, if you scroll up and look at that Internal Name column, this stuff actually matches up.  (Here is where you can see how they match up) The part that I put in red in this URL is the GUID.  It’s actually the same exact GUID twice in there.  To make it manageable for what we’re going to do, I’m going to replace those GUIDs with asterisks for now.

https://sharepoint.company.com/sitename/_layouts/user.aspx?obj=*,list&List=*

  • Copy your string above (your own, not mine) to your clipboard (the second one with the asterisks).  Click to select the green icon.  Click the <Insert> menu, and choose Hyperlink.  In the Address box, paste from your clipboard.
  • Select the first asterisk.  Click the little function button to the right of the address box.  Select the InternalName field and click OK.  Select the other asterisk, and do the same thing.  This is what it’ll look like at this point:

image (that’s the magic part) 😉

  • Click OK. Click to select the red icon, and create the exact same hyperlink on it.  Both icons are going to link to the exact same thing, but only one icon will be displayed at a time, because of conditional formatting.
  • Click to select the green icon.  On the conditional formatting pane, click the <Create> button, and choose <Show Content>.  For the condition, choose Field Name InheritedSecurity Equals true.
  • Click to select the red icon.  On the conditional formatting pane, click the <Create> button, and choose <Show Content>.  For the condition, choose Field Name InheritedSecurity Equals false.  Now the appropriate icon is displayed according to the inherited security of each of the lists.

So, do you see the pattern here? Once you know how to go to the properties page, and grab the URL of ANY properties page, you can add a column for that property, such as Title and Description, and dissect the URL, and use the InternalName to replace the GUID in the URL.  Create an entire dashboard with a column to get to any settings page for your lists!  You can remove that internal name column, it was just for you to see the data, for educational purposes.

So, for the third column in my original screenshot at the top, I simply clicked the permissions page on a list, and clicked to add a new user.  Then, I snagged that URL and dissected it.  Then, I used conditional formatting to only show that link if InheritedSecurity = false.

You all enjoy this one, and please let me know if you like it!

Oh, and here’s how to re-use this DVWP on other sites: From the browser, export the web part just as a file on your desktop.  Open the file in notepad, and simply find and replace your site’s URL with the new site you want to put this web part on.

Technorati Tags: ,,

8 comments

  • Awesome. Thanks Laura!

    Like

  • Laura, this is a great post…Thanks for sharing!

    Like

  • hrussell@draper.com

    Laura, I love this functionality, thank you. Do you have any ideas of how to extend this so that it can show item level permissions? We run into trouble at my company where people are breaking inheritance to items without really understanding what they are doing — it’s really hard to reconstruct what they’ve done!

    Like

  • hrussell, I’m not sure about item level, but I know that DeliverPoint is a great 3rd party product you can buy, to achieve that: http://www.lightningtools.com/deliverpoint/sharepoint-permission-management.aspx

    Like

  • This tool works great for list. Can you do this to show sites and subsites for the site collection?

    Like

  • Shellie,
    I don’t know, you’d just have to test other web services and see if any of them will do that. I couldn’t ever find one that would. This web service only shows lists.

    Like

  • Hello,

    Couldn’t find first 14 steps as mentioned:
    a. This post is really an expansion on a previous post of mine, called I Love the SiteData.asmx Web Service. First step: Go to that post and go all the way through step 14. We’ll pick up from there…

    Second question, have you ever posted on a web part to show User to security Usergroup relation? Would like to use this concept with spin on requirements.

    Example: Site could have 500+ Security Groups and the webpart shows which one(s) a specific user is in. Or have a complete read only list for general public.

    Thanks!

    Don’t Use Twitter:
    Information: Scott.Tauriello@gmail.com

    Like

  • Scott,
    I just fixed the hyperlink to go to the correct post. Keep in mind that these two posts were written for SharePoint 2007. As for the groups thing, I wrote a post that uses that web service, which you can also use to create a web part that shows the current user what groups they’re in. Permissions Web Part: List of Site Owners https://wonderlaura.com/2012/07/09/permissions-web-part-list-of-site-owners/

    Like

Leave a reply or question

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s