I am currently working on an Elixir application and I would like to implement role-based and access-based authorization. In Spring Security, there is a convenient syntax using the @PreAuthorize
annotation. However, I couldn’t find a similar syntax in Elixir. Are there any libraries or approaches that can help me achieve this kind of authorization in Elixir?
In Spring Security, I could use @PreAuthorize("hasRole('ROLE_ADMIN')")
to restrict access to certain roles. Is there a comparable way to achieve this in Elixir, perhaps with a similar syntax? For example, something like @security(roles: [:admin] or privileges: [:write])
.
I would appreciate any guidance on how to implement role-based and access-based authorization in Elixir, along with any recommended libraries or approaches. Thank you.