Hide parts of menu based on user role











up vote
0
down vote

favorite












I have menu that contains links to sections of website:





Products | Orders | Users
__________________________
Add | Add | Add
Update | Update | Update
Delete | Delete | Delete


Depending on what role user is in, they can see limited number of options, e.g. "User" can only see:



Products | Orders 
__________________
Add | Add
|
|


All of them redirect to the same page, but with different parameters. RedirectType (Products, Orders, Users) and RedirectTypeState (Add, Update, Delete). I would like to remove ugly @if(...) statements from this code and make it neater:





<table class="menu-table" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="70"><a asp-page="/Index" class="buttonmenu">Main page</a></td>
<td width="50"><a asp-page="/Auth/Login" class="buttonmenu">Log on</a></td>
<td width="65"></td>
<td width="60"></td>
<td width="40"></td>
<td width="50"></td>
<td width="50"></td>
</tr>
<tr>
<td colspan="6" align="right">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="HeaderStaticLabel">
<td></td>
<td></td>
<td></td>
</tr>
<tr class="HeaderStaticLabel">
<td>@if(CanSee("products", "add")){<label>Products</label>}</td>
<td>@if(CanSee("orders", "add")){<label>Orders</label>}</td>
<td>@if(CanSee("users", "add")){<label>Users</label>}</td>
</tr>
<tr class="menu-table-add">
<td>@if(CanSee("products", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Add" class="buttonmenu">Add</a>}</td><td></td>
<td>@if(CanSee("orders", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Add" asp-route-isMessageInfo="true" class="buttonmenu">Add</a>}</td>
<td>@if(CanSee("users", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Add" asp-route-isMessageInfo="false" class="buttonmenu">Add</a>}</td>
</tr>
<tr class="menu-table-update">
<td>@if(CanSee("products", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Update" asp-route-isMessageInfo="true" class="buttonmenu">Update</a>}</td>
<td>@if(CanSee("orders", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Update" asp-route-isMessageInfo="false" class="buttonmenu">Update</a>}</td>
<td>@if(CanSee("users", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Update" class="buttonmenu">Update</a>}</td>
</tr>
<tr class="menu-table-delete">
<td>@if(CanSee("products", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Delete" class="buttonmenu">Delete</a>}</td>
<td>@if(CanSee("orders", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Delete" asp-route-isMessageInfo="true" class="buttonmenu">Delete</a>}</td>
<td>@if(CanSee("users", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Delete" asp-route-isMessageInfo="false" class="buttonmenu">Delete</a>}</td>
</tr>
</table>
</td>
</tr>
</table>

@functions
{
bool CanSee(string claimName, string claimValue) => User.Identity.IsAuthenticated && User.HasClaim(claimName, claimValue);
}


Some of them have additional route parameters, such as asp-route-isMessageInfo.










share|improve this question




























    up vote
    0
    down vote

    favorite












    I have menu that contains links to sections of website:





    Products | Orders | Users
    __________________________
    Add | Add | Add
    Update | Update | Update
    Delete | Delete | Delete


    Depending on what role user is in, they can see limited number of options, e.g. "User" can only see:



    Products | Orders 
    __________________
    Add | Add
    |
    |


    All of them redirect to the same page, but with different parameters. RedirectType (Products, Orders, Users) and RedirectTypeState (Add, Update, Delete). I would like to remove ugly @if(...) statements from this code and make it neater:





    <table class="menu-table" border="0" cellspacing="2" cellpadding="2">
    <tr>
    <td width="70"><a asp-page="/Index" class="buttonmenu">Main page</a></td>
    <td width="50"><a asp-page="/Auth/Login" class="buttonmenu">Log on</a></td>
    <td width="65"></td>
    <td width="60"></td>
    <td width="40"></td>
    <td width="50"></td>
    <td width="50"></td>
    </tr>
    <tr>
    <td colspan="6" align="right">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr class="HeaderStaticLabel">
    <td></td>
    <td></td>
    <td></td>
    </tr>
    <tr class="HeaderStaticLabel">
    <td>@if(CanSee("products", "add")){<label>Products</label>}</td>
    <td>@if(CanSee("orders", "add")){<label>Orders</label>}</td>
    <td>@if(CanSee("users", "add")){<label>Users</label>}</td>
    </tr>
    <tr class="menu-table-add">
    <td>@if(CanSee("products", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Add" class="buttonmenu">Add</a>}</td><td></td>
    <td>@if(CanSee("orders", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Add" asp-route-isMessageInfo="true" class="buttonmenu">Add</a>}</td>
    <td>@if(CanSee("users", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Add" asp-route-isMessageInfo="false" class="buttonmenu">Add</a>}</td>
    </tr>
    <tr class="menu-table-update">
    <td>@if(CanSee("products", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Update" asp-route-isMessageInfo="true" class="buttonmenu">Update</a>}</td>
    <td>@if(CanSee("orders", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Update" asp-route-isMessageInfo="false" class="buttonmenu">Update</a>}</td>
    <td>@if(CanSee("users", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Update" class="buttonmenu">Update</a>}</td>
    </tr>
    <tr class="menu-table-delete">
    <td>@if(CanSee("products", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Delete" class="buttonmenu">Delete</a>}</td>
    <td>@if(CanSee("orders", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Delete" asp-route-isMessageInfo="true" class="buttonmenu">Delete</a>}</td>
    <td>@if(CanSee("users", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Delete" asp-route-isMessageInfo="false" class="buttonmenu">Delete</a>}</td>
    </tr>
    </table>
    </td>
    </tr>
    </table>

    @functions
    {
    bool CanSee(string claimName, string claimValue) => User.Identity.IsAuthenticated && User.HasClaim(claimName, claimValue);
    }


    Some of them have additional route parameters, such as asp-route-isMessageInfo.










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have menu that contains links to sections of website:





      Products | Orders | Users
      __________________________
      Add | Add | Add
      Update | Update | Update
      Delete | Delete | Delete


      Depending on what role user is in, they can see limited number of options, e.g. "User" can only see:



      Products | Orders 
      __________________
      Add | Add
      |
      |


      All of them redirect to the same page, but with different parameters. RedirectType (Products, Orders, Users) and RedirectTypeState (Add, Update, Delete). I would like to remove ugly @if(...) statements from this code and make it neater:





      <table class="menu-table" border="0" cellspacing="2" cellpadding="2">
      <tr>
      <td width="70"><a asp-page="/Index" class="buttonmenu">Main page</a></td>
      <td width="50"><a asp-page="/Auth/Login" class="buttonmenu">Log on</a></td>
      <td width="65"></td>
      <td width="60"></td>
      <td width="40"></td>
      <td width="50"></td>
      <td width="50"></td>
      </tr>
      <tr>
      <td colspan="6" align="right">
      <table border="0" cellspacing="0" cellpadding="0">
      <tr class="HeaderStaticLabel">
      <td></td>
      <td></td>
      <td></td>
      </tr>
      <tr class="HeaderStaticLabel">
      <td>@if(CanSee("products", "add")){<label>Products</label>}</td>
      <td>@if(CanSee("orders", "add")){<label>Orders</label>}</td>
      <td>@if(CanSee("users", "add")){<label>Users</label>}</td>
      </tr>
      <tr class="menu-table-add">
      <td>@if(CanSee("products", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Add" class="buttonmenu">Add</a>}</td><td></td>
      <td>@if(CanSee("orders", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Add" asp-route-isMessageInfo="true" class="buttonmenu">Add</a>}</td>
      <td>@if(CanSee("users", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Add" asp-route-isMessageInfo="false" class="buttonmenu">Add</a>}</td>
      </tr>
      <tr class="menu-table-update">
      <td>@if(CanSee("products", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Update" asp-route-isMessageInfo="true" class="buttonmenu">Update</a>}</td>
      <td>@if(CanSee("orders", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Update" asp-route-isMessageInfo="false" class="buttonmenu">Update</a>}</td>
      <td>@if(CanSee("users", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Update" class="buttonmenu">Update</a>}</td>
      </tr>
      <tr class="menu-table-delete">
      <td>@if(CanSee("products", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Delete" class="buttonmenu">Delete</a>}</td>
      <td>@if(CanSee("orders", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Delete" asp-route-isMessageInfo="true" class="buttonmenu">Delete</a>}</td>
      <td>@if(CanSee("users", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Delete" asp-route-isMessageInfo="false" class="buttonmenu">Delete</a>}</td>
      </tr>
      </table>
      </td>
      </tr>
      </table>

      @functions
      {
      bool CanSee(string claimName, string claimValue) => User.Identity.IsAuthenticated && User.HasClaim(claimName, claimValue);
      }


      Some of them have additional route parameters, such as asp-route-isMessageInfo.










      share|improve this question















      I have menu that contains links to sections of website:





      Products | Orders | Users
      __________________________
      Add | Add | Add
      Update | Update | Update
      Delete | Delete | Delete


      Depending on what role user is in, they can see limited number of options, e.g. "User" can only see:



      Products | Orders 
      __________________
      Add | Add
      |
      |


      All of them redirect to the same page, but with different parameters. RedirectType (Products, Orders, Users) and RedirectTypeState (Add, Update, Delete). I would like to remove ugly @if(...) statements from this code and make it neater:





      <table class="menu-table" border="0" cellspacing="2" cellpadding="2">
      <tr>
      <td width="70"><a asp-page="/Index" class="buttonmenu">Main page</a></td>
      <td width="50"><a asp-page="/Auth/Login" class="buttonmenu">Log on</a></td>
      <td width="65"></td>
      <td width="60"></td>
      <td width="40"></td>
      <td width="50"></td>
      <td width="50"></td>
      </tr>
      <tr>
      <td colspan="6" align="right">
      <table border="0" cellspacing="0" cellpadding="0">
      <tr class="HeaderStaticLabel">
      <td></td>
      <td></td>
      <td></td>
      </tr>
      <tr class="HeaderStaticLabel">
      <td>@if(CanSee("products", "add")){<label>Products</label>}</td>
      <td>@if(CanSee("orders", "add")){<label>Orders</label>}</td>
      <td>@if(CanSee("users", "add")){<label>Users</label>}</td>
      </tr>
      <tr class="menu-table-add">
      <td>@if(CanSee("products", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Add" class="buttonmenu">Add</a>}</td><td></td>
      <td>@if(CanSee("orders", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Add" asp-route-isMessageInfo="true" class="buttonmenu">Add</a>}</td>
      <td>@if(CanSee("users", "add")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Add" asp-route-isMessageInfo="false" class="buttonmenu">Add</a>}</td>
      </tr>
      <tr class="menu-table-update">
      <td>@if(CanSee("products", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Update" asp-route-isMessageInfo="true" class="buttonmenu">Update</a>}</td>
      <td>@if(CanSee("orders", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Update" asp-route-isMessageInfo="false" class="buttonmenu">Update</a>}</td>
      <td>@if(CanSee("users", "update")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Update" class="buttonmenu">Update</a>}</td>
      </tr>
      <tr class="menu-table-delete">
      <td>@if(CanSee("products", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Products" asp-route-state="@RedirectTypeStates.Delete" class="buttonmenu">Delete</a>}</td>
      <td>@if(CanSee("orders", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Orders" asp-route-state="@RedirectTypeStates.Delete" asp-route-isMessageInfo="true" class="buttonmenu">Delete</a>}</td>
      <td>@if(CanSee("users", "delete")){<a asp-page="/Find/Index" asp-route-type="@RedirectTypes.Users" asp-route-state="@RedirectTypeStates.Delete" asp-route-isMessageInfo="false" class="buttonmenu">Delete</a>}</td>
      </tr>
      </table>
      </td>
      </tr>
      </table>

      @functions
      {
      bool CanSee(string claimName, string claimValue) => User.Identity.IsAuthenticated && User.HasClaim(claimName, claimValue);
      }


      Some of them have additional route parameters, such as asp-route-isMessageInfo.







      c# asp.net-core






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago









      Jamal

      30.2k11115226




      30.2k11115226










      asked 20 hours ago









      FCin

      1354




      1354






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          The problem is that you're running against the limitations of Razor here. Ideally you'd have a function that loops though the various options -- add, update, delete -- and for each generates a relevant <tr> and its accompanying <td>s based on the claims User has the rights to.



          I'm guessing that's possible in Razor, but I fear you'd end up with a significant amount of methods that all call each other -- e.g. a function to create a <tr> block that calls a function to create a <td> line, etc. -- which wouldn't exactly make things clearer.



          Would it be possible for you to go full ASP.NET Core MVC? That way you can have such code in classes, have extension methods for User, etc. I did so in a recent project and it works like a charm, while still being easy to maintain.






          share|improve this answer





















          • I have to stick to Razor Pages. I was thinking about storing a dictionary with mapping of claim to url. Then I would have 3 list of AddUrls, UpdateUrls, DeleteUrls, and foreach on each of them to render <td>'s in html, but I'm afraid that it would actually decrease readibility.
            – FCin
            18 hours ago













          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "196"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f208110%2fhide-parts-of-menu-based-on-user-role%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          The problem is that you're running against the limitations of Razor here. Ideally you'd have a function that loops though the various options -- add, update, delete -- and for each generates a relevant <tr> and its accompanying <td>s based on the claims User has the rights to.



          I'm guessing that's possible in Razor, but I fear you'd end up with a significant amount of methods that all call each other -- e.g. a function to create a <tr> block that calls a function to create a <td> line, etc. -- which wouldn't exactly make things clearer.



          Would it be possible for you to go full ASP.NET Core MVC? That way you can have such code in classes, have extension methods for User, etc. I did so in a recent project and it works like a charm, while still being easy to maintain.






          share|improve this answer





















          • I have to stick to Razor Pages. I was thinking about storing a dictionary with mapping of claim to url. Then I would have 3 list of AddUrls, UpdateUrls, DeleteUrls, and foreach on each of them to render <td>'s in html, but I'm afraid that it would actually decrease readibility.
            – FCin
            18 hours ago

















          up vote
          0
          down vote













          The problem is that you're running against the limitations of Razor here. Ideally you'd have a function that loops though the various options -- add, update, delete -- and for each generates a relevant <tr> and its accompanying <td>s based on the claims User has the rights to.



          I'm guessing that's possible in Razor, but I fear you'd end up with a significant amount of methods that all call each other -- e.g. a function to create a <tr> block that calls a function to create a <td> line, etc. -- which wouldn't exactly make things clearer.



          Would it be possible for you to go full ASP.NET Core MVC? That way you can have such code in classes, have extension methods for User, etc. I did so in a recent project and it works like a charm, while still being easy to maintain.






          share|improve this answer





















          • I have to stick to Razor Pages. I was thinking about storing a dictionary with mapping of claim to url. Then I would have 3 list of AddUrls, UpdateUrls, DeleteUrls, and foreach on each of them to render <td>'s in html, but I'm afraid that it would actually decrease readibility.
            – FCin
            18 hours ago















          up vote
          0
          down vote










          up vote
          0
          down vote









          The problem is that you're running against the limitations of Razor here. Ideally you'd have a function that loops though the various options -- add, update, delete -- and for each generates a relevant <tr> and its accompanying <td>s based on the claims User has the rights to.



          I'm guessing that's possible in Razor, but I fear you'd end up with a significant amount of methods that all call each other -- e.g. a function to create a <tr> block that calls a function to create a <td> line, etc. -- which wouldn't exactly make things clearer.



          Would it be possible for you to go full ASP.NET Core MVC? That way you can have such code in classes, have extension methods for User, etc. I did so in a recent project and it works like a charm, while still being easy to maintain.






          share|improve this answer












          The problem is that you're running against the limitations of Razor here. Ideally you'd have a function that loops though the various options -- add, update, delete -- and for each generates a relevant <tr> and its accompanying <td>s based on the claims User has the rights to.



          I'm guessing that's possible in Razor, but I fear you'd end up with a significant amount of methods that all call each other -- e.g. a function to create a <tr> block that calls a function to create a <td> line, etc. -- which wouldn't exactly make things clearer.



          Would it be possible for you to go full ASP.NET Core MVC? That way you can have such code in classes, have extension methods for User, etc. I did so in a recent project and it works like a charm, while still being easy to maintain.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 19 hours ago









          BCdotWEB

          8,50511638




          8,50511638












          • I have to stick to Razor Pages. I was thinking about storing a dictionary with mapping of claim to url. Then I would have 3 list of AddUrls, UpdateUrls, DeleteUrls, and foreach on each of them to render <td>'s in html, but I'm afraid that it would actually decrease readibility.
            – FCin
            18 hours ago




















          • I have to stick to Razor Pages. I was thinking about storing a dictionary with mapping of claim to url. Then I would have 3 list of AddUrls, UpdateUrls, DeleteUrls, and foreach on each of them to render <td>'s in html, but I'm afraid that it would actually decrease readibility.
            – FCin
            18 hours ago


















          I have to stick to Razor Pages. I was thinking about storing a dictionary with mapping of claim to url. Then I would have 3 list of AddUrls, UpdateUrls, DeleteUrls, and foreach on each of them to render <td>'s in html, but I'm afraid that it would actually decrease readibility.
          – FCin
          18 hours ago






          I have to stick to Razor Pages. I was thinking about storing a dictionary with mapping of claim to url. Then I would have 3 list of AddUrls, UpdateUrls, DeleteUrls, and foreach on each of them to render <td>'s in html, but I'm afraid that it would actually decrease readibility.
          – FCin
          18 hours ago




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f208110%2fhide-parts-of-menu-based-on-user-role%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Costa Masnaga

          Fotorealismo

          Sidney Franklin