fresh_dev
fresh_dev

Reputation: 6774

When to use custom AccessDecisionManager (need a real use case)

i am just curious when i will need to use a custom AccessDecisionManager i need some use cases from your experience guys, if anyone have used it before, thanks.

Upvotes: 3

Views: 7889

Answers (2)

pera.coyote
pera.coyote

Reputation: 61

You also need a custom AcceessDecisionManager if you have complex object for a granted authority, spring default only supports string for that.

Upvotes: 0

Dave Newton
Dave Newton

Reputation: 160281

The canonical example given in the Spring Security docs is for customizing voter tallies, like if a particular voter should be weighted more heavily than others.

You could also customize behavior based on, say, properties of the secured object passed in to the decide method, for example, based on existing business logic. (That could also be handled by a custom voter, or other means, but if it's generic it might be easier to put it in a decision manager.)

IMO it's relatively unusual to need extensive customization at this level, but others may have additional insight.

Upvotes: 4

Related Questions