Granting Role-based upload access to CKEditor

Overview 

In this article, we will explain how to grant role-based upload access to the CKEditor using only the Database access and the XML configuration file. 

This procedure is very useful when the customer doesn't have access to the HTML Editor Manager.

 

Prerequisites

 

Solution

  1. Open the SQL Console
  2. Run the following query

    select RoleID from Roles where RoleName like '<RoleName>'
    • Replace <RoleName> with the name of the role that you want to grant access to the CKEditor. 
  3. Run the following query.

    INSERT INTO CKE_Settings (SettingName, SettingValue) VALUES ('DNNCKP#<PortalId>#<RoleID>#uploadfileRoles#', -1)
    • Replace <PortalId> with your PortalID.
    • Replace <RoleID> with the ID collected on step 2. 

  4. Clear the server cache
  5. Access the Windows Server that host the DNN portal. 
  6. Navigate to your portal folder and go to the folder containing the portal that you want to edit. (RootFolder/Portal folder/Portal ID folder
  7. Open the Dnn.CKEditorSettings.xml file. 
  8. Search for the following string for your role, for example the Administrator role"<BrowserRoles>0;Administrators;</BrowserRoles>". 
  9. Append the RoleID to the BrowserRoles node

    • Example, if the role that you want to add has Role ID 4; Your node should look like this: 

      <BrowserRoles>0;Administrators;4;</BrowserRoles>
  10. Save the file
  11. Access the CKEditor using the updated role to make sure that the change was correctly applied. 

 

Testing

  1. Access any account that is in the role that you've provided access to.
  2. Go to Edit mode and Edit an HTML Pro module.
  3. Go to Advanced Editor.
  4. Click Upload File

If you are able to upload a file, that means the above solution was successful.

Comments

0 comments

Please sign in to leave a comment.