I am assuming you are doing this with Razor?
I'm also assuming you are using Identity to handle your authentication.
If that's the case you should see this answer first:
https://stackoverflow.com/a/45675054/6709649
Get your user's roles with this code:
var user = await _userManager.FindByNameAsync(User.Identity.Name);
//Return true if any of the found roles are equal to "Supplier"
bool isSupplier = await _userManager.GetRoles(user.Id).Any(x => x == "Supplier");
From there you can create a flag on the model you are passing into the razor view:
public class MyViewModel{
public IsSupplier { get; set; }
...
}
And then set MyViewModel.IsSupplier = isSupplier
that you found above. In your razor view you can then use a simple if statement to detect whether you show an ajax popup or not:
@if(Model.IsSupplier){
<!-- Some HTML here to show the popup -->
}