Table of Contents

Interface IGraphPermission

Namespace
PnP.Core.Model.Security
Assembly
PnP.Core.dll

The permission resource provides information about a sharing permission granted for a driveItem resource. Sharing permissions have a number of different forms. The permission resource represents these different forms through facets on the resource. Note: OneDrive for Business and SharePoint document libraries do not return the inheritedFrom property. grantedTo and grantedToIdentities will be deprecated going forward and the response will be migrated to grantedToV2 and grantedToIdentitiesV2 respectively under appropriate property names.

public interface IGraphPermission : IDataModel<IGraphPermission>, IDataModelParent, IDataModelWithContext, ISupportModules<IGraphPermission>
Inherited Members
Extension Methods

Properties

ExpirationDateTime

A format of yyyy-MM-ddTHH:mm:ssZ of DateTimeOffset indicates the expiration time of the permission. DateTime.MinValue indicates there is no expiration set for this permission. Optional.

DateTime ExpirationDateTime { get; }

Property Value

DateTime

GrantedToIdentitiesV2

For link type permissions, the details of the users to whom permission was granted. Note: Read-only.

List<ISharePointIdentitySet> GrantedToIdentitiesV2 { get; }

Property Value

List<ISharePointIdentitySet>

GrantedToV2

For user type permissions, the details of the users and applications for this permission. Note: Read-only.

ISharePointIdentitySet GrantedToV2 { get; }

Property Value

ISharePointIdentitySet

HasPassword

Indicates whether the password is set for this permission. Note: This property only appears in the response. Optional. Read-only. For OneDrive Personal only.

bool HasPassword { get; }

Property Value

bool

Id

The unique identifier of the permission among all permissions on the item. Note: Read-only.

string Id { get; }

Property Value

string

Invitation

Details of any associated sharing invitation for this permission. Note: Read-only.

ISharingInvitation Invitation { get; }

Property Value

ISharingInvitation

Provides the link details of the current permission, if it is a link type permissions. Note: Read-only.

ISharingLink Link { get; }

Property Value

ISharingLink

Roles

The type of permission

List<PermissionRole> Roles { get; }

Property Value

List<PermissionRole>

ShareId

A unique token that can be used to access this shared item via the shares API. Note: Read-only.

string ShareId { get; }

Property Value

string

Methods

DeletePermission()

Delete a specific permission

void DeletePermission()

DeletePermissionAsync()

Delete a specific permission

Task DeletePermissionAsync()

Returns

Task

GrantUserPermissions(List<IDriveRecipient>)

Adds permissions for a set of users to a specific permission

IGraphPermission GrantUserPermissions(List<IDriveRecipient> recipients)

Parameters

recipients List<IDriveRecipient>

List of recipients to add

Returns

IGraphPermission

GrantUserPermissionsAsync(List<IDriveRecipient>)

Adds permissions for a set of users to a specific permission

Task<IGraphPermission> GrantUserPermissionsAsync(List<IDriveRecipient> recipients)

Parameters

recipients List<IDriveRecipient>

List of recipients to add

Returns

Task<IGraphPermission>

RemoveUserPermissions(List<IDriveRecipient>)

Removes permissions for a set of users from a specific permission

IGraphPermission RemoveUserPermissions(List<IDriveRecipient> recipients)

Parameters

recipients List<IDriveRecipient>

List of recipients to remove

Returns

IGraphPermission

RemoveUserPermissionsAsync(List<IDriveRecipient>)

Removes permissions for a set of users from a specific permission

Task<IGraphPermission> RemoveUserPermissionsAsync(List<IDriveRecipient> recipients)

Parameters

recipients List<IDriveRecipient>

List of recipients to remove

Returns

Task<IGraphPermission>