Hi all,
Just a quick question, hoping someone has done this before:
1. I have a table called "security_questions" which contains like 20 or so security questions that users can choose when they register on my side.
2. I have used Grocery CRUD for admins to manage the questions.
3. When users choose their security questions on signup, a separate table "user_security_questions" is populated with their question ID and their respective answers.
4. I want to be able to prevent deletion/deactivation of an item that is in use by any user.
Is there a quick way to do this? Anybody done similar things before? I am thinking a callback "before delete" and then check if the ID is in use, then return false if so, but perhaps there is something better, such as not showing the delete icon in the first place in list view?
The alternative to finding a way to delete the item in the "user_security_question" at the time of delete via a callback is not ideal, because in the event of there being only one security question, the user's security question will be deleted.
Any ideas will be appreciated!
Kind regards,
Kobus