Back to Devexpress

ProtectedRange.CreateSecurityDescriptor(IEnumerable<EditRangePermission>) Method

officefileapi-devexpress-dot-spreadsheet-dot-protectedrange-dot-createsecuritydescriptor-x28-system-dot-collections-dot-generic-dot-ienumerable-devexpress-dot-spreadsheet-dot-editrangepermission-x29.md

latest6.7 KB
Original Source

ProtectedRange.CreateSecurityDescriptor(IEnumerable<EditRangePermission>) Method

Creates a security descriptor for the current protected range.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
string CreateSecurityDescriptor(
    IEnumerable<EditRangePermission> permissions
)
vb
Function CreateSecurityDescriptor(
    permissions As IEnumerable(Of EditRangePermission)
) As String

Parameters

NameTypeDescription
permissionsIEnumerable<EditRangePermission>

A collection of EditRangePermission objects specifying user and access rights.

|

Returns

TypeDescription
String

A string that stores information about a security descriptor in SDDL (Security Descriptor Definition Language) format.

|

Remarks

The CreateSecurityDescriptor method creates a security descriptor containing information on users and respective access rights (defined in the EditRangePermission object). Use the ProtectedRange.SecurityDescriptor property to associate security descriptor with the protected range.

Access rights are in effect when the worksheet is protected (use the Worksheet.Protect method to apply protection to the worksheet).

Users and groups not listed in the range permissions must enter a password specified by the ProtectedRange.SetPassword method to edit the range.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateSecurityDescriptor(IEnumerable<EditRangePermission>) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_API_Part02/SpreadsheetActions/ProtectionActions.cs#L61

csharp
permission.Deny = false;
protectedRange.SecurityDescriptor = protectedRange.CreateSecurityDescriptor(new EditRangePermission[] { permission });
protectedRange.SetPassword("123");

wpf-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_WPF_API_Part02/SpreadsheetActions/ProtectionActions.cs#L59

csharp
permission.Deny = false;
protectedRange.SecurityDescriptor = protectedRange.CreateSecurityDescriptor(new EditRangePermission[] { permission });
protectedRange.SetPassword("123");

spreadsheet-document-api-examples-part2/CS/SpreadsheetDocServerAPIPart2/CodeExamples/ProtectionActions.cs#L87

csharp
permission.Deny = false;
protectedRange.SecurityDescriptor = protectedRange.CreateSecurityDescriptor(new EditRangePermission[] { permission });
protectedRange.SetPassword("123");

winforms-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_API_Part02/SpreadsheetActions/ProtectionActions.vb#L66

vb
permission.Deny = False
protectedRange.SecurityDescriptor = protectedRange.CreateSecurityDescriptor(New EditRangePermission() { permission })
protectedRange.SetPassword("123")

wpf-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_WPF_API_Part02/SpreadsheetActions/ProtectionActions.vb#L64

vb
permission.Deny = False
protectedRange.SecurityDescriptor = protectedRange.CreateSecurityDescriptor(New EditRangePermission() { permission })
protectedRange.SetPassword("123")

spreadsheet-document-api-examples-part2/VB/SpreadsheetDocServerAPIPart2/CodeExamples/ProtectionActions.vb#L82

vb
permission.Deny = False
protectedRange.SecurityDescriptor = protectedRange.CreateSecurityDescriptor(New EditRangePermission() { permission })
protectedRange.SetPassword("123")

See Also

EditRangePermission

Protect(String, WorksheetProtectionPermissions)

SetPassword(String)

ProtectedRange Interface

ProtectedRange Members

DevExpress.Spreadsheet Namespace