This content is archived. See latest version here

Last updated: Jul 09 2014


It is possible to control which groups are allowed to view and select a certain component. This is done by defining the AllowedRoles property for a component definition. It is also possible to hide a component completely by setting the Allowed Roles property to “none”. Setting it to null/String. Empty simply means that no access check should be done. The following example shows how to hide or show a certain component depending on a global setting:

    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.DefaultAssetsGroup };

            if (!EPiServer.Configuration.Settings.Instance.UseLegacyFileManagerMode)

Do you have feedback on this documentation? Send an email to For development-related questions and discussions, refer to our Forums on