# Rich Text Editor Customization

> Source: https://agilitycms.com/docs/developers/rich-text-editor-customization

> **Classic Content Manager only** — This hook runs only in the classic Content Manager. The current Content Manager doesn't run it. To extend the rich text editor in the current Content Manager, build an app. See [Extending the Rich Text Editor with an App](https://agilitycms.com/docs/apps/extending-the-rich-text-editor).

In Agility CMS Rich Text Area can be customized with a script hook that fires on initialization of the Rich Text Area component or any HTML field on Component and Content Models. The script, `ContentManager.Global.RichTextAreaOnInit`, that will fire can be defined in inline code section of Agility CMS. 

Once the inline code is defined, it can be setup to be loaded by Agility CMS by going to **Settings** > **Content** **Editor** > **Advanced**.

![](https://cdn.aglty.io/agility-cms-docs/block-editor/developerarticles/Screen-Shot-2021-10-20-at-11.16.02-AM-10202021151637.png)

This functionality could be used for customizing the actions that a user can perform based on their role/permissions that are setup in the instance. Following snippet removes a button from default rich text area buttons. 

```
(function () {
    //get current website user
    ContentManager.DataAccess.WebsiteUser(
        ContentManager.Global.NavContext.websiteName, 
        function (resp) {
            //check the Permission attribute of resp
            if (!resp.Permission.Deny) {
                //define the RichTextAreaOnInit script hook
                ContentManager.Global.RichTextAreaOnInit = function (editor) {
                    //parameter "editor" that is passed in is the 
                    //constructed rich text area js object.
                    //remove edithtmlcode button
                    editor.buttons.edithtmlcode = null;
                }
            }
        }
    );
})(); 
```

t

---

## Related pages

- [Agility CMS MCP Server](https://agilitycms.com/docs/developers/agility-cms-mcp-server.md)
- [Extending the CMS](https://agilitycms.com/docs/developers/extending-the-cms.md)
- [Custom Sections](https://agilitycms.com/docs/developers/custom-sections.md)
- [Webhooks](https://agilitycms.com/docs/developers/webhooks.md)
- [Apps](https://agilitycms.com/docs/developers/apps.md)
- [Updating Legacy Input Forms](https://agilitycms.com/docs/developers/updating-legacy-input-forms.md)
- [Custom Asset Domains](https://agilitycms.com/docs/developers/custom-asset-domains.md)
- [Publishing to Social Channels](https://agilitycms.com/docs/developers/publishing-to-social-channels.md)
- [Agility Decorate](https://agilitycms.com/docs/developers/agility-decorate.md)
- [Connect the Agility MCP Server to Microsoft 365 Copilot](https://agilitycms.com/docs/developers/connect-agility-mcp-server-to-microsoft-365-copilot.md)
- [Verifying Signed Webhooks](https://agilitycms.com/docs/developers/verifying-signed-webhooks.md)
- [Migrating Content into Agility with an AI Agent](https://agilitycms.com/docs/developers/migrating-content-with-an-ai-agent.md)
- [Webhook Events and Payload Reference](https://agilitycms.com/docs/developers/webhook-events-and-payloads.md)

Index of every docs page: https://agilitycms.com/docs/llms.txt
