DNN Dynamic Roles Tip 3: Show content for users that are members of Role1 and Role2

Using DNN’s default role system, you may know the following issue: When restricting the visibility of your site’s module to specific roles, the roles are connected by a logical OR. However, there are situations where you want a module to be visible only if a user is a member of two (or more) roles. Creating a separate new (combined) role and managing role memberships manually is complex and error-prone. DNN Dynamic Roles makes this job easy by extending DNN’s standard permission system and automating the process of managing role memberships.

2014-11-12_ScreenshotPermissionGrid

To do this, create a new dynamic role and use the following ruleset (replace the role names “Role1” and “Role2” with your correct role names):

<and>
    <member role="Role1"/>
    <member role="Role2"/>
</and>

Set “Trigger” to “Request” and “Update Method” to “Sync”.

After creating this new role, you can use the new dynamic role as any other DNN role in each module’s permission settings.

 

More information: