Authorization of UI elements

Hi, I was wondering if anyone has an tips on what libraries they use for building in authorization into the UI. For example, to hide/disable/enable certain UI buttons or elements based on the role/permissions someone has. I was exploring using CASL ( to manage the actually permissions.