Removing permission

3 posts, 1 answers
  1. Jeffrey
    Jeffrey avatar
    21 posts
    Member since:
    Mar 2014

    Posted 22 Apr 2018 Link to this post

    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. Answer
    Dimitar
    Admin
    Dimitar avatar
    2823 posts

    Posted 23 Apr 2018 Link to this post

    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.
  3. Jeffrey
    Jeffrey avatar
    21 posts
    Member since:
    Mar 2014

    Posted 23 Apr 2018 in reply to Dimitar Link to this post

    Thanks this worked perfectly!
Back to Top