Hi there,
I have developed an Appgini web application and is functioning very well but my concern is that Client wants to allow some users to delete records in Application level but not in Database Level if this is possible please help me.
Otherwise, if not possible is there a way we can audit or create logs that lets us understand who deleted the records for exmaple:
1. user logins with username password
2. goes to table X and deletes a record
I want the system too:
1. Create a log where all the deleted records are logged with information from which particular user was the action performed and the date when it occurs.
Any help would be highly appreciated
Audit deleted records
Re: Audit deleted records
Hello Vaalonv,
i would like to help you in your questions
first for auditing you can do it by making a log table in you project , call it log table and you can insert in this table through after delete hook functioin
you can read more about delete hook function though this link
http://bigprof.com/appgini/help/advance ... ter_delete
and for the second question (deleting client side only )
you can add an extra column in the table call it flag this column values will be 0 or 1
and then in before delete hook function update the deleted record field (the flag you made) the deleted record will take value 1
and return false in before delete to prevent the actual delete from database
then force a filter on this table though init function to show only records in this table that have flag value 0 (non deleted ones)
those are my two ideas for your questions
you can read more about before delete function and init function from the following links
before delete
http://bigprof.com/appgini/help/advance ... ore_delete
init function
http://bigprof.com/appgini/help/advance ... ename_init
i would like to help you in your questions
first for auditing you can do it by making a log table in you project , call it log table and you can insert in this table through after delete hook functioin
you can read more about delete hook function though this link
http://bigprof.com/appgini/help/advance ... ter_delete
and for the second question (deleting client side only )
you can add an extra column in the table call it flag this column values will be 0 or 1
and then in before delete hook function update the deleted record field (the flag you made) the deleted record will take value 1
and return false in before delete to prevent the actual delete from database
then force a filter on this table though init function to show only records in this table that have flag value 0 (non deleted ones)
those are my two ideas for your questions
you can read more about before delete function and init function from the following links
before delete
http://bigprof.com/appgini/help/advance ... ore_delete
init function
http://bigprof.com/appgini/help/advance ... ename_init