This topic is locked

Security to part of a table

3/21/2009 1:20:46 AM
ASPRunnerPro General questions
A
Aussie Mick author

G'day everyone. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=11312&image=1&table=forumtopics' class='bbc_emoticon' alt=':D' />
I have a page on my site that links to a table which lists informaton on Transport Contractors. This information needs to be edited by all staff as it contains address information etc, but there is one field in the table that states whether they are Compliant or Not Compliant with our company terms. This one field I dont want to allow every user to change, just two people within the business.
How would I go about restricting access to this field, would this be done in permissions. Is it even possible?
Thanks

R
Roger 3/21/2009

You bet.
Note: there is no FIELD level permissions, but you could do this in the Sub BeforeShowEdit(xt,templatefile) event
Use something like this:
if it's an Ordinary User do not even show the field

xt.assign "FIELDNAME_fieldblock",Ucase(SESSION("UserID"))="SUPER ACCOUNT USER"
"SUPER ACCOUNT USER" would be the Admin types that can edit.
I do this all the time and it works like a charm.
Hope it helps.
Roger