views:

61

answers:

3

Hello

I want to copy the permissions of a user and to another user. I know i can do it by creating a group with required permissions and adding the users will do it. But i dont want to create a group. Is there a way to copy the permissions of a user to another user directly?

NLV

A: 

There is no way to copy permissions between users through SharePoint itself, you will have to write a script to do it for you.

Ian
What script? Can you explain?
NLV
+1  A: 

You need to write code that will;

  1. Check if the current site inherits permissions or sets its own
  2. From the site that sets permissions (self or ancestor, depending on 1) go over the RoleAssignments collections
  3. For each role assignment check if your source user is specified
  4. If so, create a role assignment for the target user

This code must run under administrative privileges (RunWithElevatedPrivilegese will suffice if written as web part)

Vladi Gubler
Can a single user/group have multiple RoleAssignments?
NLV
yes, if he is in multiple groups
Vladi Gubler