grants & revokes
Posted in 2006
Topics: Server Administration, Security, Permissions & Auditing
I'm having trouble understanding grant/revoke on my informix database.
I'm logged onto the server as a "regular" user -- fred.
Vw_rim_department is a simple view that pulls two columns out of a
table. I'm in DBAccess, and I give the following statement:
select * from vw_rim_department
to which it responds:
272: No SELECT permission.
So, from a different shell as the user, informix, I go into DBAccess and
issue this:
Grant all on vw_rim_department to public
Grant all on vw_rim_department to fred
Back in my first session as fred, I again say:
select * from vw_rim_department
to which it again responds:
272: No SELECT permission.
So I think I'll start from scratch, and I go to my informix session and
say:
Revoke all on vw_rim_department from public
And it responds:
Warning:privilege not revoked.
I expected a grant all to public followed by a grant all to fred would
definitely give fred select permission on the view.
So my question is either:
A. Why doesn't it?
B. Where can I find a tutorial/documentation on how this works
C. <a bonus question> How can I tell what privileges a
table/view/column currently has?
Thanks,
Brian McLaughlin
Administrative Computing
George Fox University
(503) 554-2587
Brian McLaughlin wrote:
> I'm having trouble understanding grant/revoke on my informix database.
>
>
>
> I'm logged onto the server as a "regular" user -- fred.
> Vw_rim_department is a simple view that pulls two columns out of a
> table. I'm in DBAccess, and I give the following statement:
>
> select * from vw_rim_department>
>
>
> to which it responds:
>
> 272: No SELECT permission.>
>
>
> So, from a different shell as the user, informix, I go into DBAccess and
> issue this:
>
> Grant all on vw_rim_department to public>
> Grant all on vw_rim_department to fred>
>
>
> Back in my first session as fred, I again say:
>
> select * from vw_rim_department>
>
>
> to which it again responds:
>
> 272: No SELECT permission.>
>
>
>
>
> So I think I'll start from scratch, and I go to my informix session and
> say:
>
> Revoke all on vw_rim_department from public>
>
>
> And it responds:
>
> Warning:privilege not revoked.
>
>
>
> I expected a grant all to public followed by a grant all to fred would
> definitely give fred select permission on the view.
>
>
>
> So my question is either:
>
> A. Why doesn't it?
> B. Where can I find a tutorial/documentation on how this works
> C. <a bonus question> How can I tell what privileges a
> table/view/column currently has?
>
>
>
> Thanks,
>
>
>
> Brian McLaughlin
>
> Administrative Computing
>
> George Fox University
>
> (503) 554-2587
>
>
> ------_=_NextPart_001_01C66981.0AD3B33A
> Content-Type: text/html
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 9026
>
> <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
>
> <head>
> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
> <meta name=Generator content="Microsoft Word 11 (filtered medium)">
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="PlaceType"/>
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="place"/>
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="PlaceName"/>
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="PersonName"/>
> <!--[if !mso]>
> <style>
> st1\\:*{behavior:url(#default#ieooui) }
> </style>
> <![endif]-->
> <style>
> <!--
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal
> {margin:0in;
> margin-bottom:.0001pt;
> font-size:12.0pt;
> font-family:"Times New Roman";}
> a:link, span.MsoHyperlink
> {color:blue;
> text-decoration:underline;}
> a:visited, span.MsoHyperlinkFollowed
> {color:purple;
> text-decoration:underline;}
> span.EmailStyle17
> {mso-style-type:personal-compose;
> font-family:Arial;
> color:windowtext;}
> @page Section1
> {size:8.5in 11.0in;
> margin:1.0in 1.25in 1.0in 1.25in;}
> div.Section1
> {page:Section1;}
> /* List Definitions */
> @list l0
> {mso-list-id:1675836047;
> mso-list-type:hybrid;
> mso-list-template-ids:1091755486 67698709 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
> @list l0:level1
> {mso-level-number-format:alpha-upper;
> mso-level-tab-stop:.5in;
> mso-level-number-position:left;
> text-indent:-.25in;}
> ol
> {margin-bottom:0in;}
> ul
> {margin-bottom:0in;}
> -->
> </style>
>
> </head>
>
> <body lang=EN-US link=blue vlink=purple>
>
> <div class=Section1>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>I’m having trouble understanding grant/revoke on my
> informix database.<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>I’m logged onto the server as a “regular”
> user -- fred. Vw_rim_department is a simple view that pulls two columns out of
> a table. I’m in DBAccess, and I give the following statement:<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>select * from vw_rim_department<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>to which it responds:<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>272: No SELECT permission.<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>So, from a different shell as the user, informix, I go into
> DBAccess and issue this:<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>Grant all on vw_rim_department to public<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>Grant all on vw_rim_department to fred<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>Back in my first session as fred, I again say:<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>select * from vw_rim_department<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>to which it again responds:<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'>272: No SELECT permission.<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
> font-family:Arial'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 face=Arial><sp
> So, from a different shell as the user, informix, I go into DBAccess and
> issue this:
>
> Grant all on vw_rim_department to public>
> Grant all on vw_rim_department to fred>
>
>
> Back in my first session as fred, I again say:
>
> select * from vw_rim_department>
if i recall correctly you have to reconnect to your database.
so:
as for example user informix grant the permissions
THEN as user fred start dbaccess and do your selects should work.
> A. Why doesn't it?
see above drop us a line if it does not.
> B. Where can I find a tutorial/documentation on how this works
if i recall correctly the guide to sql
> C. <a bonus question> How can I tell what privileges a
> table/view/column currently has?
dbschema -d <yourdbname> -p all |grep <yourtable>
or dbaccess -->> choose your dbexecute in query lang:
info privileges for <yourtable>
or in the menu choose info -->> table your table and choose option
privileges.
Superboer.