Table of Contents

Interface ISecurableObject

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

Defines the properties and methods for securable object (Web, List, ListItem)

public interface ISecurableObject

Properties

HasUniqueRoleAssignments

Returns if the securable object has unique role assignments

bool HasUniqueRoleAssignments { get; }

Property Value

bool

RoleAssignments

Role Assignments defined on this securable object Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IRoleAssignmentCollection RoleAssignments { get; }

Property Value

IRoleAssignmentCollection

Methods

AddRoleDefinition(int, IRoleDefinition)

Add role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

void AddRoleDefinition(int principalId, IRoleDefinition roleDefinition)

Parameters

principalId int
roleDefinition IRoleDefinition

Role definition to add

AddRoleDefinitionAsync(int, IRoleDefinition)

Adds role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task AddRoleDefinitionAsync(int principalId, IRoleDefinition roleDefinition)

Parameters

principalId int
roleDefinition IRoleDefinition

Role definition to add

Returns

Task

AddRoleDefinitionBatch(Batch, int, IRoleDefinition)

Add role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

void AddRoleDefinitionBatch(Batch batch, int principalId, IRoleDefinition roleDefinition)

Parameters

batch Batch

The batch to add this request to

principalId int
roleDefinition IRoleDefinition

Role definition to add

AddRoleDefinitionBatch(int, IRoleDefinition)

Add role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

void AddRoleDefinitionBatch(int principalId, IRoleDefinition roleDefinition)

Parameters

principalId int
roleDefinition IRoleDefinition

Role definition to add

AddRoleDefinitionBatchAsync(Batch, int, IRoleDefinition)

Adds role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task AddRoleDefinitionBatchAsync(Batch batch, int principalId, IRoleDefinition roleDefinition)

Parameters

batch Batch

The batch to add this request to

principalId int
roleDefinition IRoleDefinition

Role definition to add

Returns

Task

AddRoleDefinitionBatchAsync(int, IRoleDefinition)

Adds role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task AddRoleDefinitionBatchAsync(int principalId, IRoleDefinition roleDefinition)

Parameters

principalId int
roleDefinition IRoleDefinition

Role definition to add

Returns

Task

AddRoleDefinitions(int, params string[])

Adds roles for a specific principal id (IUser.Id or ISharePointGroup.Id)

bool AddRoleDefinitions(int principalId, params string[] names)

Parameters

principalId int

Id of the user or group

names string[]

Roles to add

Returns

bool

AddRoleDefinitionsAsync(int, params string[])

Adds roles for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task<bool> AddRoleDefinitionsAsync(int principalId, params string[] names)

Parameters

principalId int

Id of the user or group

names string[]

Roles to add

Returns

Task<bool>

BreakRoleInheritance(bool, bool)

Creates unique role assignments for this securable object.

void BreakRoleInheritance(bool copyRoleAssignments, bool clearSubscopes)

Parameters

copyRoleAssignments bool

Specifies whether to copy the role assignments from the parent securable object. If the value is false, the collection of role assignments must contain only 1 role assignment containing the current user after the operation.

clearSubscopes bool

If the securable object is a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects in the current site and in the sites which inherit role assignments from the current site must be cleared and those securable objects will inherit role assignments from the current site after this call. If the securable object is a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged. If the securable object is not a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects must be cleared and those securable objects will inherit role assignments from the current securable object after this call. If the securable object is not a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged.

BreakRoleInheritanceAsync(bool, bool)

Creates unique role assignments for this securable object.

Task BreakRoleInheritanceAsync(bool copyRoleAssignments, bool clearSubscopes)

Parameters

copyRoleAssignments bool

Specifies whether to copy the role assignments from the parent securable object. If the value is false, the collection of role assignments must contain only 1 role assignment containing the current user after the operation.

clearSubscopes bool

If the securable object is a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects in the current site and in the sites which inherit role assignments from the current site must be cleared and those securable objects will inherit role assignments from the current site after this call. If the securable object is a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged. If the securable object is not a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects must be cleared and those securable objects will inherit role assignments from the current securable object after this call. If the securable object is not a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged.

Returns

Task

BreakRoleInheritanceBatch(Batch, bool, bool)

Creates unique role assignments for this securable object.

void BreakRoleInheritanceBatch(Batch batch, bool copyRoleAssignments, bool clearSubscopes)

Parameters

batch Batch

Batch add this request to

copyRoleAssignments bool

Specifies whether to copy the role assignments from the parent securable object. If the value is false, the collection of role assignments must contain only 1 role assignment containing the current user after the operation.

clearSubscopes bool

If the securable object is a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects in the current site and in the sites which inherit role assignments from the current site must be cleared and those securable objects will inherit role assignments from the current site after this call. If the securable object is a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged. If the securable object is not a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects must be cleared and those securable objects will inherit role assignments from the current securable object after this call. If the securable object is not a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged.

BreakRoleInheritanceBatch(bool, bool)

Creates unique role assignments for this securable object.

void BreakRoleInheritanceBatch(bool copyRoleAssignments, bool clearSubscopes)

Parameters

copyRoleAssignments bool

Specifies whether to copy the role assignments from the parent securable object. If the value is false, the collection of role assignments must contain only 1 role assignment containing the current user after the operation.

clearSubscopes bool

If the securable object is a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects in the current site and in the sites which inherit role assignments from the current site must be cleared and those securable objects will inherit role assignments from the current site after this call. If the securable object is a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged. If the securable object is not a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects must be cleared and those securable objects will inherit role assignments from the current securable object after this call. If the securable object is not a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged.

BreakRoleInheritanceBatchAsync(Batch, bool, bool)

Creates unique role assignments for this securable object.

Task BreakRoleInheritanceBatchAsync(Batch batch, bool copyRoleAssignments, bool clearSubscopes)

Parameters

batch Batch

Batch add this request to

copyRoleAssignments bool

Specifies whether to copy the role assignments from the parent securable object. If the value is false, the collection of role assignments must contain only 1 role assignment containing the current user after the operation.

clearSubscopes bool

If the securable object is a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects in the current site and in the sites which inherit role assignments from the current site must be cleared and those securable objects will inherit role assignments from the current site after this call. If the securable object is a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged. If the securable object is not a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects must be cleared and those securable objects will inherit role assignments from the current securable object after this call. If the securable object is not a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged.

Returns

Task

BreakRoleInheritanceBatchAsync(bool, bool)

Creates unique role assignments for this securable object.

Task BreakRoleInheritanceBatchAsync(bool copyRoleAssignments, bool clearSubscopes)

Parameters

copyRoleAssignments bool

Specifies whether to copy the role assignments from the parent securable object. If the value is false, the collection of role assignments must contain only 1 role assignment containing the current user after the operation.

clearSubscopes bool

If the securable object is a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects in the current site and in the sites which inherit role assignments from the current site must be cleared and those securable objects will inherit role assignments from the current site after this call. If the securable object is a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged. If the securable object is not a site, and the clearsubscopes parameter is true, the role assignments for all child securable objects must be cleared and those securable objects will inherit role assignments from the current securable object after this call. If the securable object is not a site, and the clearsubscopes parameter is false, the role assignments for all child securable objects which do not inherit role assignments from their parent object must remain unchanged.

Returns

Task

GetRoleDefinitions(int)

Returns the roles for a specific principal id (IUser.Id or ISharePointGroup.Id)

IRoleDefinitionCollection GetRoleDefinitions(int principalId)

Parameters

principalId int

Id of the user or group

Returns

IRoleDefinitionCollection

GetRoleDefinitionsAsync(int)

Returns the roles for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task<IRoleDefinitionCollection> GetRoleDefinitionsAsync(int principalId)

Parameters

principalId int

Id of the user or group

Returns

Task<IRoleDefinitionCollection>

RemoveRoleDefinition(int, IRoleDefinition)

Removes role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

void RemoveRoleDefinition(int principalId, IRoleDefinition roleDefinition)

Parameters

principalId int
roleDefinition IRoleDefinition

Role definition to remove

RemoveRoleDefinitionAsync(int, IRoleDefinition)

Removes role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task RemoveRoleDefinitionAsync(int principalId, IRoleDefinition roleDefinition)

Parameters

principalId int
roleDefinition IRoleDefinition

Role definition to remove

Returns

Task

RemoveRoleDefinitionBatch(Batch, int, IRoleDefinition)

Removes role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

void RemoveRoleDefinitionBatch(Batch batch, int principalId, IRoleDefinition roleDefinition)

Parameters

batch Batch

The batch to add this request to

principalId int
roleDefinition IRoleDefinition

Role definition to remove

RemoveRoleDefinitionBatch(int, IRoleDefinition)

Removes role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

void RemoveRoleDefinitionBatch(int principalId, IRoleDefinition roleDefinition)

Parameters

principalId int
roleDefinition IRoleDefinition

Role definition to remove

RemoveRoleDefinitionBatchAsync(Batch, int, IRoleDefinition)

Removes role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task RemoveRoleDefinitionBatchAsync(Batch batch, int principalId, IRoleDefinition roleDefinition)

Parameters

batch Batch

The batch to add this request to

principalId int
roleDefinition IRoleDefinition

Role definition to remove

Returns

Task

RemoveRoleDefinitionBatchAsync(int, IRoleDefinition)

Removes role definitions for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task RemoveRoleDefinitionBatchAsync(int principalId, IRoleDefinition roleDefinition)

Parameters

principalId int
roleDefinition IRoleDefinition

Role definition to remove

Returns

Task

RemoveRoleDefinitions(int, params string[])

Removes roles for a specific principal id (IUser.Id or ISharePointGroup.Id)

bool RemoveRoleDefinitions(int principalId, params string[] names)

Parameters

principalId int

Id of the user or group

names string[]

Roles to remove

Returns

bool

RemoveRoleDefinitionsAsync(int, params string[])

Removes role for a specific principal id (IUser.Id or ISharePointGroup.Id)

Task<bool> RemoveRoleDefinitionsAsync(int principalId, params string[] names)

Parameters

principalId int

Id of the user or group

names string[]

Roles to remove

Returns

Task<bool>

ResetRoleInheritance()

Removes the local role assignments so that the web, and all its descendant objects, re-inherit role assignments from the parent object.

void ResetRoleInheritance()

ResetRoleInheritanceAsync()

Removes the local role assignments so that the web, and all its descendant objects, re-inherit role assignments from the parent object.

Task ResetRoleInheritanceAsync()

Returns

Task

ResetRoleInheritanceBatch()

Removes the local role assignments so that the web, and all its descendant objects, re-inherit role assignments from the parent object.

void ResetRoleInheritanceBatch()

ResetRoleInheritanceBatch(Batch)

Removes the local role assignments so that the web, and all its descendant objects, re-inherit role assignments from the parent object.

void ResetRoleInheritanceBatch(Batch batch)

Parameters

batch Batch

The batch to add this request to

ResetRoleInheritanceBatchAsync()

Removes the local role assignments so that the web, and all its descendant objects, re-inherit role assignments from the parent object.

Task ResetRoleInheritanceBatchAsync()

Returns

Task

ResetRoleInheritanceBatchAsync(Batch)

Removes the local role assignments so that the web, and all its descendant objects, re-inherit role assignments from the parent object.

Task ResetRoleInheritanceBatchAsync(Batch batch)

Parameters

batch Batch

The batch to add this request to

Returns

Task