You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is the right place where I could ask this. Anyway
Has somebody done RBAC with templ? How do you deliver different html based on user context?
My usecase: I have an application where you have member and team leads, only the team lead can modify the team entity or add/remove member to the system.
From a backend perspective I have an idea how to implement that, based on user role. But how can I hide certain elements in the final html without creating for every possibility a new route and html template?
I want to avoid massiv if statements. Maybe a wrapper component which handles this could be an idea.
Propagating the user context to every possible nested component feels also little bit off but don't think there is a way around it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all
Not sure if this is the right place where I could ask this. Anyway
Has somebody done RBAC with templ? How do you deliver different html based on user context?
My usecase: I have an application where you have member and team leads, only the team lead can modify the team entity or add/remove member to the system.
From a backend perspective I have an idea how to implement that, based on user role. But how can I hide certain elements in the final html without creating for every possibility a new route and html template?
I want to avoid massiv if statements. Maybe a wrapper component which handles this could be an idea.
Propagating the user context to every possible nested component feels also little bit off but don't think there is a way around it.
Has somebody some ideas?
Beta Was this translation helpful? Give feedback.
All reactions