Re: Granting the privileges to users on number of tables
Posted in 1991
>
> I have number of tables that I would like to give access to users. Currently,
> I am using INFORMIX/SQL to do this one at a time. Is there anyway I can
> run this in a group if I have it in a file?
Try the following bourne shell script
------------Cut Here-------------
#!/bin/sh
tput clear
echo "\\n\\n Grant Support Permissions to user
=================================\\n\\n"
echo "Enter the user login id which is to be granted permissions\\n
Login ID = \\c"
read i
grep "^$i:" /etc/passwd >/dev/null
if [ $? != 0 ]
then
echo "\\n\\n Login ID does not exist";
exit;
fi
isql << HERE
database help_desk;
revoke connect from $i;
grant connect to $i;
revoke all on system_ref from $i;
grant select on system_ref to $i;
grant insert on frl_txt to $i;
grant update on seq_no to $i;
HERE
echo "\\nSupport permission granted"
--------------Cut Here----------------------
>
> By the way, I like to understand the table authorization "su-id--" that is
> generated table systabauth. Is there anywhere in INFORMIX book I can read
> more about it?
>
As far as I know this is not documented, but it appears to be pretty
straight forward. Each character location deals with a seperate
permission and the values are "-" = no permission, "lower case
letter" = user has permission, "upper case letter" = user has and can
grant permission.
s = select, u = update, * = column permissions have been applied, i =
insert, d = delete, x = index, a = alter.
As it is undocumented there is no guarantee that Informix will not
change the way it works either to add new facilities or to conform to
new ANSI standards. Despite this I often use this table to provide
permissions information so that I can check whether a user is allowed
to update particular database entities. It does mean that you don't
have to build your own security system but can use the Informix
controls for application level security.
Hope this helps!
Cheers,
Jim
--------------------------------------------------------------------
Name: Jim Gordon Internet: jgordon@ssf-sys.DHL.COM
Company: DHL Systems Inc Phone: (415) 358-5911 (Work)
Address: 1700 S. Amphlett Blvd. (415) 882-9728 (Home)
San Mateo, CA 94402 Fax: (415) 571-6429
--------------------------------------------------------------------