on-internet
← Community

NestJS authorization

Stack Overflow ·

https://docs.nestjs.com/security/authorization Good morning guys. According to NestJS documentation, I can create policies that will be then used per endpoint or so. My only doubt is that the policies created in the docs are pretty simple and do not evaluate instances of an object, just if user has permission to do certain action on a subject. How would it look like if I needed to evaluate an instance in my policies, or is there a better pattern? Example: I need to check if the user can delete a post, and for that the post needs to belong to him. In order to do that, I need the post instance f

Comments

Sign in or sign up to comment and upvote.

No comments yet.