In my viewset how can I add logic for user roles, if user is in a certain role then show button.
The object @Model does not contain any user/portal info since the DNN adds it already in @Dnn, please see the following code for solution:
@if (Dnn.User.IsInRole(Dnn.PortalSettings.AdministratorRoleName))
{
<span>@(Dnn.PortalSettings.AdministratorRoleName)</span>
}
At your service,
Dave Smith
|
|