Create a new SPRoleDefinition with only Add Items permission on the Site

Source

Hello bloggers, sometimes in our companies or in our customers, we receive a requirement that the lists and / or document libraries in SharePoint 2010 it should have specific permissions "only some people can add items but don't see them on the list". What happened if we want to use the GUI to set the permissions? this happens:

Step 1: Go to Site actions\Site settigs\Site Permissions

image

Step 2: Permissions Level\Add a Permission Level

image

 

Step 3: if you click on the "Add Items" checkbox, the "view items" checkbox is also selected. This is because in the GUI these two permissions are dependent on one another.

image

To solve the requirement, In this case, we can use PowerShell to make it. There is a PowerShell cmdlet for creating / editing permission levels of the root site. This cmdlet is “New-Object Microsoft.SharePoint.SPRoleDefinition. Let's see how to use it:

1. We need to get the web information

2. Create an instance of the New-Object

3. Assign a name for the new Role

4. Assign a description

5. Assign the base permissions

6. Assign the new role to web

7. dispose the web element

here the entire PowerShell:

image

 

Using the following command, you can see all Base Permissions:

image

image

I hope this information helps,

 

Regards,

 

Andrés Rojas

MVP_FullColor_ForScreen MCITP(rgb)_1349  MCPD(rgb)_1350
MCTS(rgb)_1076_1348_1347_1342

0 comentarios:

Publicar un comentario