Subject Re: [ib-support] Re: previleges according to date
Author Helen Borrie
At 09:15 AM 29/12/2002 +0000, you wrote:
>Ann,
>
> > It might be easier to define views for normal users that are
>restricted to the set of records they can access
>
>this was my first idea, but then I performed some tests that made me
>reject it.
>
>1. I built a very simple table:
>
>create table test_table (
>field_date timestamp
>)
>
>2. I inserted 2 records:
>
>insert into test_table values ('2002-12-29');
>insert into test_table values ('2002-12-30');
>
>3. I built a view
>
>create view test_view (field_date) as
>select field_date from test_table where field_date>='2002-12-30';
>
>4. I tested the view:
>
>select field_date from test_view
>
>and - as expected - only 1 record was shown ('2002-12-30')
>
>5. I wrote
>
>insert into test_view values ('2002-12-29');
>
>and IT WAS ACCEPTED.
>
>So you see that a view cannot be of much help in my case, as I must
>prevent a normal user from inserting dates before a given date.

Dulio,

Use WITH CHECK OPTION in your CREATE VIEW statement - this prevents insert
or update operations that violate the search conditions specified in the
WHERE clause.

heLen