Software Programmer
asked on
How to provide access or grant based on custom conditions
Assume i want to provide grant an user based on certain conditions not based on roles or permissions or anything.
Assume a user hits the url /getAllOrders. i need to give access if satisfies certain conditions.
In that case, i am not sure how to do it. I checked and come across AccessDecisionVoter and not sure whether it will be suitable for it and also don't know how to implement it.
can someone suggest whethere AccessDecisionVoter would be the right option ?
looking for working sample code snippet which uses AccessDecisionVoter
Thanks.
Assume a user hits the url /getAllOrders. i need to give access if satisfies certain conditions.
In that case, i am not sure how to do it. I checked and come across AccessDecisionVoter and not sure whether it will be suitable for it and also don't know how to implement it.
can someone suggest whethere AccessDecisionVoter would be the right option ?
looking for working sample code snippet which uses AccessDecisionVoter
Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you use a WebSecurityConfigurerAdapt er you should be fine.
ASKER
Can u please help me with a sample code snippet for the above?
ASKER
User status should be active
User should be part of a specific group
User date should falls between certain condition
User should not have used more than the actual limit
etc.,