Search code examples
angularcasl

What is the best way to authorize to a resource in angular 8


I am trying to handle resource (or claim) based authorization in angular 8. I found an CASL angular actions abilitiy management.

So,I want to protect all crud actionswith using action based authorization in angular 8.

It should be also claims based authorization. But, I don't know which is the best way to use.

What is the best way to make action based authroization in angular 8?

Thanks


Solution

  • CASL is isomorphic, so can be used on both backend and frontend. There is a separate package for Angular @casl/angular which helps to integrate CASL easier.

    Currently the overall phylosophy of CASL is spinning around actions (or claims) and subjects. I'm working right now on CASL v4 which will have better TypeScript support and will have support for claim based authorization.

    You can use CASL even right now, look at this comment for information of how to configure Ability to use claim base authorization

    Update: by the way there is an example of integration between CASL and Angular. Related article is in README