To apply the filtering that you created when implementing IToolboxFilter interface, you need to replace the default filter. Sitefinity's default IToolboxFilter implementation is the DefaultToolboxFilter class. This class reports as visible only sections and items that are enabled. In addition, it also implements the logic for displaying backend section and items when editing a backend page.
You can replace the default filter by registering a custom instance in the ObjectFactory.
Perform the following:
NOTE: If you do not have a Global.asax file, create a new Global.asax file and add it to your project. In the context menu of your project, click Add » New Item… » Visual C# » Web » Global Application Class.
Add the following code inside the Application_Start method and hook to the ObjectFactory_Initialized event:
As a result, the DefaultToolboxFilter is replaced with your custom RoleToolboxFilter.
To test your newly registered filter that allows only users in the Administrator role to use the News widget, perform the following:
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important
Copyright © 2021 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, Ipswitch, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.
Powered by Progress Sitefinity