Changing the access levels of a list, form, etc. with an update query

bonghetti

Member
Hi, I've had this need again and I wanted to talk to you about finding an automated solution, rather than a manual one, to allow me to create a script, a button that allows me to do what I'm trying to explain.
In practice, in this case (but it could be useful for many other situations) I need to change the access levels to add to a list. in practice with a scheduler or with the updating of a yes/no field I have to deactivate the add button for access levels so I have to set a higher access level on that list to prevent users of a lower level from being able after that change or after that datetime to be able to insert data. To do this, an update query would be enough but this information on fabrik is not in specific fields but in a very structured params field. What suggestion could you give me?
 
Modifying Fabrik core tables is risky, you can crash the system - but it's up to you.

It may be possible to use something like
$listModel->getParams()->get('your-param')
and ->set('your-param',$value)

But - as I said - risky, backup DB etc.
 
Yes I realize it's risky, but I also realize the potential and it would be nice to have some implementation on this type of functionality. I take the example of the case for which I would like to use it. Meal reservations for which members book online, but registrations close on a certain date. Then in person for those attending the event, the administrator can book some other meals if there are places available. To do this I had to intervene from Backend to change the level

then with these commands: $listModel->getParams()->get('your-param')
and ->set('your-param',$value)
it would be possible?
ok I'll try and program a backup of the fabrik table at the same time
 
Not sure if this is a good example.

Such cases you better handle with e.g. two lists pointing to the same DB table, one for the public and one only accessible for admins but with add access.
Not changing list access settings in general.
 
yes, this is the approach I have used in several cases, but it is a solution that makes the job worse. All field changes, php commands and implemented codes often need to be replicated
 
I would do it with two related tables, Meals and Reservations.

Meals table would have date element with expire date and a calc element which displays the link to add a reservation if the date is not expired or display something like "Reservation ended" if date has passed.

And to make sure someone would not try to add a record via direct link, you could add a php form plugin (onBeforeProcesss) to Meals form, which checks the date and if expired, stops the form submission (return false).

If you need the "admins" to be able to add records after the registration date has passed, you can exclude some user group in your calc element and form php plugin code.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top