How to display correctly conditional tabPanel with "nothing" inside ?

Hi,

I created an authentification module in my app, and i would like to display (or not) some tabPanel according the user authentification.

Basically, it looks like :


 if(user_info()$Permissions == "admin") {
                                         tabPanel("File",
                                                   h5(""),
                                                   downloadButton("file.xls", "File"))  }
  # else {  }

Works good when permissions is 'admin' but i would like to display nothing when permissions is not equal to admin.

With the "else { }" method, it appears "tab-xxxx-x" ( probably href values) at the end of each tabPanel pages.

Is there a way to not display the reference tab value or other way to display "nothing" correctly ?

I try others alternatives like else { return(NULL) } or else { "" }, invisible() etc.. but nothing works as expected.

When i use a "else { tabPanel("") }" method, works "ok" but not optimum cause i have an invisible tabPanel refers to a blank page.

Thanks a lot

Perhaps you could use ?renderUI() to dynamicly build the tabPanel (or not) depending on you authentication conditional. If you provide a link to a minimal example for your app, I could be more specific.