RE: urgent help required with informix forms.
Posted in 1999
I do this a lot. It will work with some tweaking. I use separate DISPLAY and
UPDATE forms, then I can control who updates by comparing usernames captured
at logon, while others still can access the data in display only. I also use
a DELETE form, for further protection. I also am stuck with 7.1 for now -
ugh.
> -----Original Message-----
> From: Jonathan Leffler [SMTP:jleffler@earthlink.net]
> Sent: Friday, July 23, 1999 3:15 AM
> To: informix-list@iiug.org
> Subject: Re: urgent help required with informix forms.
>
> Arvind Sharma wrote:
> >
> > Hi,
> > I have run into a problem just before my release. We are using
> > ESQL-C to access informix in our application but for some of the menus
> > we just use the informix forms to access database tables. We use the
> > system command in ESQL C to run (sperform -s xx.frm).
> > In one such form the users update their record. This record contains
> > some information for the user along with his userid. All these
> > information go into a database table. Now suddenly the users came up
> > with the requirement that don't want anybody else to update the
> > information of a user. That means one can only update his information in
> > this form. As I said there is a field called USER in the form. So now
> > anybody can enter this field and update anybody's record.
> > I want to make this field as read only and populate it always with
> > the userid(unix userid) whebever someone accesses this form. The first
> > part is easy but is there a way we can achieve the second thing i.e.
> > populate the field always with the unix userid(LOGNAME) variable? If yes
> > you have saved me or else I can think of only one way i.e. make 100
> > forms for hundred users and hard code that field for each of them, but
> > this is a very crude way. If any of you have some better idea please let
> > me know ASAP. Please send a copy of your reply to email id
> > (asharma@uswest.com) as sometimes I have some problem getting to the
> > group.
> >
> > Any help of any kind will be greatly appreciated. We are on version
> > 7.24.UCU of ESQL and 7.24.UD1 of ISQL and 7.20.UD1 of sperform. We use
> > this on HP-UX release 10.20.
>
> This sounds like an application crying for the use of a view:
>
> CREATE VIEW SecureTable AS
> SELECT * FROM UnSecureTable WHERE UserName = USER;>
> On the UnSecureTable, you only grant SELECT privileges to the general
> public. On the SecureTable (actually a view), the table owner grants
> others UPDATE (?INSERT, ??DELETE) privileges on the view. The form
> references the view.
>
> This is hypothetical; I'm not certain that it will work.
>
> --
> Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
> Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
> #include <disclaimer.h>