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.
Software ProgrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrei RodionovCommented:
Hi,

I'm not an expert in Spring but I hope that discussion can help:
https://stackoverflow.com/questions/24587531/spring-security-accessdecisionvoter
0
girionisCommented:
Assume i want to provide grant an user based on certain conditions

What conditions are they? I explained in one of your other questions that you probably do not need an AccessDecisionVoter.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Software ProgrammerAuthor Commented:
Condition is

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.,
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

girionisCommented:
If you use a WebSecurityConfigurerAdapter  you should be fine.
0
Software ProgrammerAuthor Commented:
Can u please help me with a sample code snippet for the above?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.