Table of contents
TOC
Collapse the table of content
Expand the table of content

SecurityExtensions.AddPermissionLevelToUser Method

SharePoint Dev Documents|Last Updated: 5/20/2017
|
1 Contributor

Add a role definition (e.g.Contribute, Read, Approve) to a user

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Syntax

public static void AddPermissionLevelToUser(this SecurableObject securableObject, String userLoginName, String roleDefinitionName, Boolean removeExistingPermissionLevels = False)

Parameters

securableObject

  Type: Microsoft.SharePoint.Client.SecurableObject
  Web/List/Item to operate against

userLoginName

  Type: System.String
  Loginname of the user

roleDefinitionName

  Type: System.String
  Name of the role definition to add, Full Control|Design|Contribute|Read|Approve|Manage Hierarchy|Restricted Read. Use the correct name of the language of the root site you are using

(optional) removeExistingPermissionLevels

  Type: System.Boolean
  Set to true to remove all other permission levels for that user

Return Value

Type: void

See also

© 2018 Microsoft