Permissions on views
Posted in 1991
Nigel Brickenden <brick@bcr.bellcore.com> writes (quoting me)
> >A couple of guys suggested using views for protection. This is
> >okay provided that there's no means of going straight to the
> >base table (i.e., the user can't call isql, etc), but the
> >protection on the base table has to be similar to that on
> >the view. In other words, if the guy can select off the view,
> >he can select off the base table and probably get more info.
>
> This is incorrect. You can have select permission on a view without having
> select permission on the base table(s) that the view is constructed on.
I thought that they were meant to work like paragraph 2, but ...
Run the following script as informix, but substituting your login
(!= informix) for mine.
----8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<---
:
isql - <<-HERE
create database foo;
grant connect to public;
create table blug
(
col1 char(20),
col2 char(20)
);
insert into blug values ("hello", "bye");
insert into blug values ("hello", "theskett");
insert into blug values ("hello", "informix");
revoke all on blug from public;{ grant select on blug to public; }
create view myview as select * from blug where col2 = user;
grant select on myview to public;
HERE
----8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<---
Now log in as yourself, run isql and do "select * from blug".
Isql comes back with "272: No select permission"
Drop the database, uncomment the grant statement and comment out
the revoke. Run the script again. This time you get one
row returned.
Your thoughts ?
--
Cheers - Tony.
____________________________________________________________________________
Tony Heskett: theskett@lhr-sys.ssf-sys.dhl.com | Vox: (+44) 81 747 8330
DHL Systems : Kings House, Great West Road, TW8 9HS | Fax: (+44) 81 747 0875