So something very strange,below are the alert values:
- consumerSupportEditableRole = true
- superAdminRole = false
- combinedRole = false
However the strange thing is that the the alert on the combinedRole give me consumerSupport/ConsumerContact/GetEmailLog. So it is for some ungodly reason going in the if block. I would expect it to go to the else block and the alert should spit Implementation/Organization/GetEmailLog
var consumerSupportEditableRole = '@(Roles.IsUserInRole("Consumer Support Editable") ? "true" : "false")';
var superAdminRole = '@(Roles.IsUserInRole("Super Admin") ? "false" : "true")';
var combinedRole = consumerSupportEditableRole && superAdminRole
alert("consumerSupportEditableRole: " + consumerSupportEditableRole);
alert("superAdminRole: " + superAdminRole);
alert("superAdminRole && consumerSupportEditableRole: " + combinedRole);
if (combinedRole)
{
var url = '@Url.Action("GetEmailLog", "ConsumerContact", new { Area = "ConsumerSupport" })';
}
else
{
var url = '@Url.Action("GetEmailLog", "Organization", new { Area = "Implementation" })';
}