Subject | Re: Password-Lock a row in a table |
---|---|
Author | Adam |
Post date | 2005-01-24T12:00:55Z |
What about a control or gateway table
For example
MyTable
(
ID,
Name,
Details
)
Sec_MyTable
(
ID,
MyTableID,
PasswordHash
)
Your trigger could then raise the exception if there exists a record
in this table with your MyTableID. You could then control the adding
and removal of the Sec_MyTable entries with a stored procedure, and
implement the password hash inside a UDF.
Adam
--- In firebird-support@yahoogroups.com, "yuraukar" <yuraukar@h...>
wrote:
For example
MyTable
(
ID,
Name,
Details
)
Sec_MyTable
(
ID,
MyTableID,
PasswordHash
)
Your trigger could then raise the exception if there exists a record
in this table with your MyTableID. You could then control the adding
and removal of the Sec_MyTable entries with a stored procedure, and
implement the password hash inside a UDF.
Adam
--- In firebird-support@yahoogroups.com, "yuraukar" <yuraukar@h...>
wrote:
>follows:
> I am trying to password-lock a row in a table. The purpose is as
> A user should be able to lock an individual row in a table from(could
> modification (no, this has nothing to do with concurrency).
> Any attempt to modify data in that row should then be rejected.
>
> The easy solution is to have a column that stores the password
> be encrypted, but for testing it's clear text). If the column isNULL,
> any changes are accepted, otherwise they are rejected through atrigger
>unlock
> CREATE TRIGGER protect_my_table FOR my_table
> ACTIVE BEFORE UPDATE POSITION 1
> AS
> BEGIN
> IF (OLD.passwd IS NOT NULL) THEN BEGIN
> EXCEPT protection_exception;
> END
> END
>
> This however also locks the user from removing the password to
> the row later on. I was thinking about a stored procedure that -given
> the password and row ID - would remove the password, but came to noYou
> working AND secure solution.
>
> Any help or ideas from the group?
>
> Yuraukar.
>
> BTW: Thanks for the very very good support from the FB team here!
> have saved my from numerous troubles and increased my understandingof
> databases in general and firebird very much.