RoleLayerRule.OrchardCore is an Orchard Core CMS Module that adds aGlobalMethod
, calledrole. The method returnstrue
if the current user is in the specfified role, otherwisefalse
.
This method can be used as part of a layer rule to specify that widgets in a layer only be displayed to users in certain roles.


Add the NuGet package,RoleLayerRule.OrchardCore, to the Orchard Core CMS Website. Launch the website and sign in as an administrator to enable the module from the dashboard underConfiguration ->Modules.

Create a new layer and specify that widgets in the layer are only visible toAdministrators
using the newrole layer rule.

Create a widget in a visible zone and specify that it is in the restricted layer created above. In this case, I created aliquid widget in theContent zone and placed it in the newAdmin layer.

Browse to a route displaying the zone and verify that the widget is only displayed to users in theAdministrators
role.
There are no known bugs.
There are no plans to add any additional features.
RoleLayerRule.OrchardCore is created and maintained by David Hayden.