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

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:

I'm not an expert in Spring but I hope that discussion can help:
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.

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
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

If you use a WebSecurityConfigurerAdapter  you should be fine.
Software ProgrammerAuthor Commented:
Can u please help me with a sample code snippet for the above?
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

From novice to tech pro — start learning today.