---
title: Hide or control access to customized components
slug: cms-13/docs/hide-or-control-access-to-a-component
createdAt: 2026-07-30T20:22:01.868Z
---

Restrict component visibility to specific user groups with the `AllowedRoles` property on component definitions. Set `AllowedRoles` to `"none"` to hide a component from all users. Set it to a null string to skip the access check entirely.

The following example hides the file management component from all users:

```csharp
[Component]
public class FileManagementComponent: ComponentDefinitionBase {
  public FileManagementComponent(): base("epi-cms.component.FileManagement") {
    Categories = new string[] {
      "cms"
    };
    LanguagePath = "/episerver/cms/components/filemanagement";
    SortOrder = 200;
    PlugInAreas = new string[] {
      PlugInArea.AssetsDefaultGroup
    };

    AllowedRoles.Clear();
    AllowedRoles.Add("none");
  }
}
```
