Subject Re: How to make a table read-only?
Author Adam
--- In firebird-support@yahoogroups.com, "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
DBMS.

> 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.

eg

if (CURRENT_USER<>'SYSDBA') then
begin
exception eGetLost;
end

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.

Adam