Subject Re: [IBO] Globally switching app to read-only mode
Author Andeas Hesse
Am 11.12.2013 20:40, schrieb ez_bikbon@...:
 

Hi,

I need to provide a read-only mode in my application, under certain circumstances (*).

(* For the interested:
This is a financial reports application that manages multi-year data.
When the financial report for a certain year is finalized and signed, the year must be closed for modifications.
Users should be allowed to log into a "closed year" to view and manipulate data on screen, but must not be allowed to make any modifications.
However users that log into an "open year" should be able to insert, update and delete data.)

I was hoping to find some way to globally block all write operations on the connection level, however I could not find any such property, method or event that may be useful.

There is a ReadOnly property on the transaction level, but it poses two major problems:

1. I have to add code to each form to set this property if the user is in a "closed year". I could not find any way to intercept transaction creation and so I can do it in one place.

2. Worse, once a transaction's ReadOnly is True, I have to take care not to call the dataset methods Insert, Edit and Delete. This means that I have to test for ReadOnly before any such method call, meaning hundreds of places in the code.

I hope someone has an idea how to globally make a connection Read Only, otherwise I'm in for a lot of dirty work...

BTW I use D7 with IBO v4.5.

Thanks,

EZ


For Security reasons I would implement the readonly features of the data on DB Level as Trigger.

And if a query is readonly (not life) you should not be able to do an insert or edit the data.

Which components of ibo are you using (native or TDataset compatible)?

--
Andreas