How do I check with a store whether the player has the necessary license?

Hello everyone,
I am now hitting my limits. I would like to make a store usable if the player has the necessary license. If the player does not have this license, he can not buy anything in the store. How does the query look, that if the player has the license can use the store XY, that is, he can buy there. Licenses are available in the database, that give this license also works, only I have the problem how I must insert the control with the license at the store. Would be very grateful dir your help.