Ability to check for permission group using keys instead of group name

In order to hide/unhide a component based on permission, we need to check if the group with the correct permission/group name exists in the current_user.groups array. Relying solely on group names for hiding and unhiding components presents a risk: if the group name changes, all associated permission checks could become invalid, leading to failures. Conversely, utilizing IDs, while more stable, sacrifices readability and necessitates extra lookup steps to determine the group associated with each ID. To enhance this process, I suggest that Retool offer a feature enabling the assignment of keys to permission groups. This would allow us to create meaningful keys and employ them for permission checks, offering a more robust and readable solution compared to using group names or IDs.

2 Likes

+1

Had the same issue and ended up using attributes instead.

1 Like