Deadbolt for Java

The Deadbolt for Java Developer Hub

Welcome to the Deadbolt for Java developer hub. You'll find comprehensive guides and documentation to help you start working with Deadbolt for Java as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    
Ask A Question

Questions

Designing Resource Owner Check

Posted by Rishabh Joshi 3 months ago

Hi,

I would like to create a custom/dynamic constraint where I would check if the resource is owned by the current Subject.
Currently, I am solving this by retrieving the requested resource and checking against the created_by field. If it matches, the custom constraint returns true, else false.

Now, my problem is that I want to return a 404, instead of 403 (which would be returned by default as the method would return false.), if the resource is not found.

How can I design my constraint to do that?

Regards,
Rishabh

Loading comments...