insightsengineering / teal

Exploratory Web Apps for Analyzing Clinical Trial Data
https://insightsengineering.github.io/teal/
Other
171 stars 34 forks source link

[Question]: <How to get components of the session outside of a teal module? > #1153

Open NanduKrishnan-H opened 5 months ago

NanduKrishnan-H commented 5 months ago

What is your question?

I am trying to restrict user access to different teal modules in an app and I need to identify the current session user and control the list of modules passed to the init() function. Is there a way to get the session$user in a teal app outside the module definition?

Code of Conduct

Contribution Guidelines

Security Policy

chlebowa commented 5 months ago

session$userData is available across the app.

Do you want to control user access from the app level or from the module level? Or before the init call? :thinking:

NanduKrishnan-H commented 5 months ago

I want control it at module level before the init call. Suppose there are 4 modules in a teal app and a specific set of users should only see 2 modules(tabs) when they open the app. In a normal shiny app we can hide and show tabs/modules by defining the logic in the main server, but I couldn't find a way to do it in a teal app. Is it possible to add user specific customization to a teal app?

chlebowa commented 5 months ago

This is not a feature we currently offer. We assume that all modules use the same data and access to data can be guarded using a teal_data_module.

If you are using your own modules I suppose you can reach into session$userData and work from there.

We will discuss this internally and let you know if this is a feature we foresee being added.