This topic is locked

Show Edit on List Page Conditionally

9/30/2005 3:19:44 PM
ASPRunnerPro General questions
S
stevemcm author

Hello;
I want to be able to limit a user's ability to edit a record from the list page depending on value in the field on the record.
For example, if there's a 'Y' in the Processed field on the list page, I don't want to show the Edit url. If, however, the field contains an 'N' then the user can edit the field.
I know it's possible to add quite a bit of security at the user level, but I think this would require a modification of the .._list.asp page.
In looking at the ##EDITBUTTON## section, it seems as though I could add some code to reference the If rs("Field1') = 'Y' then...
Thanks

Sergey Kornilov admin 10/3/2005

Hi,
you need to find this line:

if CheckSecurity(strOwnerID, "Edit")=True then

...


and modify it about this way:

if CheckSecurity(strOwnerID, "Edit")=True and rs("Processed")="N" then

...