[ic] Just a Small Question?!?! (I hope)

Mike Heins mikeh@minivend.com
Thu, 11 Jan 2001 15:17:31 -0500


Quoting Justin Bonds - Hyper Tech (justin@hypertech.net):
> Hi,
> 
> I have been working with the demo of Interchange and I absolutely love it.
> I can't believe that a great product such as this is free (ok - I think that
> it's free), especially since something similar to this, using Windows, would
> cost literally thousands!!!
> 
> But anyway, the reason that I'm writing is to see if any of you have a
> solution to my situation.  In the Access area, it allows you to set
> permissions.  That's great!  But, I have tried many different settings but I
> can't seem to land on the correct way to accomplish what I'd like to.
> 
> So, here it is:  I would like to have an employee be able to add a product,
> but not be able to edit the product after it has been added.  I have removed
> the edit check mark and left the Create checked, but obviously it needs the
> edit (due to the error message presented) to Create a product.  I have
> worked with both the Products table, and the options at the top, but to no
> success.  I have also removed the View check so that perhaps it will let me
> just add a product, and not show a product, therefore (in my hopes) not
> allowing the employee to edit the product since they can't see it.  However,
> this too returns an error message.
> 
> Do any of you have any great suggestions as to how I could go about
> accomplishing the above?  Your help would be greatly appreciated.
> 

There isn't a standard way. With 4.7.x and the autonumbering setup,
it will be possible, but in 4.6 you cannot.

It would be possible to do with a bit of custom code on a custom
entry screen, of course. Don't have time to show exactly how, but
it would involve setting the table_control hash in the access database
to pre-assign a key to the user. For instance, if you did:

	[data
		table=userdb
		col=table_control
		key="[data session username]"
		value="{ products => { yes_keys => '00001' } }"
	]

The user would be able to add 00001 (and edit it). If you then reset the
value of table_control to remove that, they couldn't edit anything.

In 4.7.x we will have the ability to allow an insert when the key field
is autonumbered, without the ability to edit an existing record. I will look
at allowing this with a preset key as well, though the way to do that doesn't
come readily to mind.

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer