Subject Re: How to make a table read-only?
Author Adam
--- In, "russellbelding"
<russell@b...> wrote:
> Thanks Adam. The list of users changes often. So constraining uses
> is not attractive.

That is why you use Roles and assign the permissions to the role
rather than the users. You then assign the users to the role.
Firebird will then allow any user within that role whatever
permissions the role is assigned, so it is not as painful as in other

> The datafile cannot be made read-only. Adding
> before-update and before-delete trigggers with exceptions in the
> triggers will allow insertions.

Datafile or table?

In any case, if you blindly add those triggers then your table will
remain empty forever. You could use the CURRENT_USER context variable.


exception eGetLost;

Another option is to disable those triggers while you populate the
table, then enable them after they are populated. It really depends
on your business requirements, whether you are trying to implement
some sort of security, or whether you are just protecting users from
their own stupidity.