Razor 2 if user is not in one role or if user is not in another role -


i'm trying check if user in role "admin" or if user in role "publisher", because both admin , publisher meant able post articles on site. every time go create-tutorial page publisher, redirected members dashboard. if go there admin, can create articles fine.

here if-statement

if (!roles.isuserinrole("admin") || !roles.isuserinrole("publisher")) {     response.redirect("~/members/dashboard"); } 

@mclaassen answered question in comment, i'm adding answer avoid being unanswered.

change || &&


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -