This is a migrated thread and some comments may be shown as answers.

Removing permission

2 Answers 62 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Jeffrey
Top achievements
Rank 1
Jeffrey asked on 22 Apr 2018, 03:21 PM

I've used the following code example to set permissions for a selected range in a richtexteditor, however, I would like code for removing previously set permission(s) for a selection in the same richtexteditor. Any help you be appreciated, thanks!

J

'Protects current selection for current user only.
Dim info As New PermissionRangeInfo()
info.Type = PermissionType.Individual
info.Name = Me.RadRichTextEditor1.CurrentUser.Username
Dim infos As New List(Of PermissionRangeInfo)() From {info}
Me.RadRichTextEditor1.InsertPermissionRange(infos)
 
infos.Clear()

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 23 Apr 2018, 10:13 AM
Hello Jeffrey,

The following code shows how you can retrieve and delete the permission ranges:
private void radButton2_Click(object sender, EventArgs e)
{
    IEnumerable<PermissionRangeStart> markers = this.radRichTextEditor1.Document.GetAnnotationMarkersOfType<PermissionRangeStart>();
    foreach (var item in markers.ToList())
    {
        this.radRichTextEditor1.DeletePermissionRange(item);
    }
     
}

Detailed information is available here: Manipulating Annotations | RadRichTextEditor.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jeffrey
Top achievements
Rank 1
answered on 23 Apr 2018, 12:00 PM
Thanks this worked perfectly!
Tags
RichTextEditor
Asked by
Jeffrey
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Jeffrey
Top achievements
Rank 1
Share this question
or