bharal
bharal

Reputation: 16174

How to define a Deadbolt role in Java?

Deadbolt's documentation is sparse, really.

Let's say that I have a standard User. The User object I use has a method - "getThing"

I want a role that applies for a "getThing" value of more than 50.

How would I go about doing this? Is this possible, or am I misunderstanding deadbolt?

Upvotes: 0

Views: 66

Answers (1)

Steve Chaloner
Steve Chaloner

Reputation: 8202

Roles represent static constraints, e.g. the subject has role x and access to a resource requires the subject to have role y.

For your requirements, you need to use a dynamic constraint. This is some arbitrary rule defined by you that must be satisfied to allow access to a resource.

You can read about the different constraints in the documentation, including dynamic constraints.

Upvotes: 0

Related Questions