Donnerstag, 3. Mai 2012

Set Sharepoint list folder permissions

How-To: Set folder permissions using a SPD workflow

This tutorial is going to be rather short since the procedure is the same as setting item permissions.

As you may know using item level permission security is not very performant, especially when having many items in one list. To raise the performance, folder level security is recommended.

Basically all this is about is placing items which shall have the same permissions into one folder having exactly these permissions set to it. The items inside the folder are automatically inheriting the folder permissions and the list is sped up. :-)


To set folder permissions in a SPD workflow, you just have to follow these steps:

  1. Inside a SPD workflow, choose the "Replace Item Permission" activity. If the activity is not present you might have to use an impersonation step.
  2. Create a lookup which returns the folder (Best practice here: Set the permissions after creating the folder which returns the ID of the folder)
  3. Set up your desired permissions.

Now the folder gets his permissions assigned automatically. All items inside the folder will inherit these permissions.

Please note: Always consider using groups for permissions. Assigning users directly is definitely not a good practice.

3 Kommentare:

  1. Hi!
    Good Post! thank you!
    But, you said "Assigning users directly is definitely not a good practice".

    It means that does not work if I do, or in general, with SP, is better do not?

    AntwortenLöschen
    Antworten
    1. Hi Giorgio,

      It will also work with single users. But now imagine if at some point you want to remove permissions for a single user, and that for all existing folders.

      You'd have to spend some time on that. Instead just place the user in a group and assign the permission for the group. That way you only have to remove the user from the group.

      Also, you just need to add an user to the group and he autmatically has all the permissions he needs.

      So I'd definitely recommend using groups.

      Hope that helped.

      Regards,
      Kevin

      Löschen
  2. I know that assigning permissions for a single user directly does not usually a good idea. However, I am setting up personnel folders. I am looking for a way to regularly update the folder permissions on folders in a record center to be the employee, their specific management, and HR.

    The intent is to use AD which has this information already. However, I am having difficulty trying to figure out how to identify all the folders in a document library so that I can loop through them to set the permissions with a SharePoint Designer Workflow in SharePoint 2010.

    If you have any additional pointers that would be great.

    AntwortenLöschen