title: how to hide menuItem and its contain for particular user in shiny r?
body: <p>I am creating my app where I want to hide particular menuItem and its contains depending upon user credential. I want to show everything for admin/tester but not all user. I found question in stack overflow, <a href="https://stackoverflow.com/questions/33027756/hide-an-element-box-tabs-in-shiny-dashbaord">Hide an element (box/tabs) in shiny dashbaord</a>, I am modified code as below </p>
  
  <pre><code>library(shiny)
  library(shinydashboard)
  library(shinyjs)
  
  ui &lt;- dashboardPage(
  
  dashboardHeader(title = "Set")
  ,dashboardSidebar(
     sidebarSearchForm(label = "Search...", "searchText", "searchButton"),
    sidebarMenu(
      menuItem("Port", tabName = "P", icon = icon("cog"))
      ,menuItem("Rank", tabName = "Rank", icon = icon("cog"))
      ,menuItem("Mark", tabName = "Mark", icon = icon("bar-chart"))
      ,menuItem("Read", tabName = "Read", icon = icon("file-pdf-o"))
      ,useShinyjs()
      ,menuItem("Port, tabName = "Ocean", icon = icon("heart"))
    )
    ,uiOutput('Super')
    ,uiOutput('AList')
    ,uiOutput('BList')
    ,uiOutput('DList')
    ,uiOutput('SList')
  )
  
  
  ,dashboardBody(
  ....
  )
  )
  
  server &lt;- shinyServer(function(input, output, session) {
    observeEvent(session$user,{
     if (session$user == "tester") return(NULL)
       hide(id = "Port", anim = TRUE)
   })
  }
  
  shinyApp(ui = ui, server = server) 
  </code></pre>
  
  <p>However, it is not working, Any tips ?</p>