GRANT on VIEW
Posted in 2000
A user created a view and then tried "grant all on mytable to tmpuser2" (and later to public), getting error -302: "No GRANT option or illegal option on multi-table view." Respondents explained that a multi-table view only supports SELECT privileges -- insert/update/delete, index, alter and references can't be granted on it -- so GRANT ALL fails; they also suggested running the grant as the view's owner or as informix, and finally using an AS clause (e.g. GRANT SELECT ... AS 'owner'). The poster never confirmed success, so no verified resolution is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Security, Permissions & Auditing
Hi !
I have created view to existing table from the user tmpuser1
> info access for mytable;
User Select Update Insert Delete
Index Alter
tmpuser1 All All Yes Yes
No No
Now, I want to add same access to tmpuser2, but I get following message.
> grant all on mytable to tmpuser2; 302: No GRANT option or illegal option on multi-table view.
Error in line 1Near character position 29
Any Hint ?
Thanks
Alex
Marvin,
I'm new to informix and tried this last week. It was on a multi-table view
and I received a similar error.
The issue seemed to be that only SELECT privileges are allowed on a
multi-table view and grant all is
trying to assign more "options" than allowed...
HTH,
Ben
Marvin wrote in message <38BB8E77.50B3@zag.si>...
>Hi !
>
>I have created view to existing table from the user tmpuser1
>
>> info access for mytable;
>User Select Update Insert Delete
>Index Alter
>tmpuser1 All All Yes Yes
>No No
>
>Now, I want to add same access to tmpuser2, but I get following message.
>
>> grant all on mytable to tmpuser2;> 302: No GRANT option or illegal option on multi-table view.
>Error in line 1>Near character position 29
>
>Any Hint ?
>
>
>Thanks
>Alex
Ben Draper wrote:
> I'm new to informix and tried this last week. It was on a multi-table view
> and I received a similar error.
> The issue seemed to be that only SELECT privileges are allowed on a
> multi-table view and grant all is
> trying to assign more "options" than allowed...
That's right. You can't do deletes, or inserts, or updates on
a multi-table view, so you can't grant those privileges either.
Similarly for indexing, altering and referencing.
Of course, C J Date would argue that you should be able to do
inserts, deletes and updates on many of multi-table views, but
that is a separate issue (I agree, and it would be nice, but...)
> Marvin wrote in message <38BB8E77.50B3@zag.si>...
> >I have created view to existing table from the user tmpuser1
> >
> >> info access for mytable;
> >User Select Update Insert Delete
> >Index Alter
> >tmpuser1 All All Yes Yes
> >No No
> >
> >Now, I want to add same access to tmpuser2, but I get following message.
> >
> >> grant all on mytable to tmpuser2;> > 302: No GRANT option or illegal option on multi-table view.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN
#include <disclaimer.h>
Jonathan Leffler wrote: > > Ben Draper wrote: > > > I'm new to informix and tried this last week. It was on a multi-table view > > and I received a similar error. > > The issue seemed to be that only SELECT privileges are allowed on a > > multi-table view and grant all is > > trying to assign more "options" than allowed... > > That's right. You can't do deletes, or inserts, or updates on > a multi-table view, so you can't grant those privileges either. > Similarly for indexing, altering and referencing. > > Of course, C J Date would argue that you should be able to do > inserts, deletes and updates on many of multi-table views, but > that is a separate issue (I agree, and it would be nice, but...) > Hi ! Maybe I don't understand what multi-table means, but in my VIEW, I have only one table with 6 fields. I don't think, If you create view under one username, the others can reach it. Perhaps I should grant view as a public, but I don't know how. My goal is getting information from that VIEW from two different login names. Regards Alex
Who are you logged in as when you run into the error?
As "informix" or the owner of the view, you should be able to
grant all on <view> to public;
Rudy
Marvin wrote:
> Maybe I don't understand what multi-table means, but in my VIEW, I have
> only one table with 6 fields. I don't think, If you create view under
> one
> username, the others can reach it. Perhaps I should grant view as a
> public,
> but I don't know how. My goal is getting information from that VIEW from
> two different login names.
>
> Regards
> Alex
Rudy Fernandes wrote:
>
> Who are you logged in as when you run into the error?
>
> As "informix" or the owner of the view, you should be able to
>
> grant all on <view> to public;>
> Rudy
>
> Marvin wrote:
>
> > Maybe I don't understand what multi-table means, but in my VIEW, I have
> > only one table with 6 fields. I don't think, If you create view under
> > one
> > username, the others can reach it. Perhaps I should grant view as a
> > public,
> > but I don't know how. My goal is getting information from that VIEW from
> > two different login names.
> >
> > Regards
> > Alex
I get the same message:
> grant all on mytable to public;
302: No GRANT option or illegal option on multi-table view.
Error in line 1Near character position 28
Alex
add an AS-clause, e.g.
GRANT SELECT TO 'xyz' AS 'abc'
Nona