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


Designing Resource Owner Check

Submitted by Rishabh Joshi about a month ago


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?


Loading comments...