Rey
|
| Posted: 01/06/2005, 1:59 PM |
|
How do I make sure that my application only allow user edit/update/delete their own record? How do I make use of the login info (userID and password) to "tag" the user?
Rey
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 01/06/2005, 2:05 PM |
|
Please refer to our main tutorial, which describes just that: http://docs.codecharge.com/studio/html/QuickStart/Creat...rInitEvent.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Rey
|
| Posted: 01/07/2005, 2:41 PM |
|
Hi Peter:
I still could not make it work. This is what I want to do:
I have "Paul" as the login name. On an Access database, there is a field called names with an entry item called Paul.
My intention is to compare the login name and make sure that if Paul is logged in, he can only edit/delete the record with the Paul entry on it. How do I go about it?
I tried the following (after initialize) but it would not work:
If CCGetUserID() = asred1.names.Value Then
asred1.UpdateAllowed = True
asred1.UpdateAllowed = True
asred1.DeleteAllowed = True
Else
asred1.UpdateAllowed = False
asred1.UpdateAllowed = False
asred1.DeleteAllowed = False
End if
Thanks for any help.
Rey
|
|
|
 |
Oper
Posts: 1195
|
| Posted: 01/09/2005, 7:22 PM |
|
values still not loaded while "after initialize" event.
you will need to get the value in advanced somthing like
useridinrecord = ccdlookup("useidinrecord","table","myrecord=" & request.querystring("myrecord"),dbconnection1)
then:
if ccgetuserid() = useridrecord then
.
.
..
.
.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
Rey
|
| Posted: 01/10/2005, 7:11 AM |
|
Thank Oper for the reply....
But poor me! 'pardon me if I'm still confused. Here's what I have:
Connection1
asred.mdb (Table1)
ID
State ====> test entry is "Texas"
Connection2
asredsecurity.mdb (Table2)
ID
User
Password
Group
Test value:
ID=3
User="Texas"
Password="itsme"
Group="Texas"
When I log in as "Texas" using connection2, I like the program to check the database using connection1 for the state="Texas". If asredsecurity.user.Value=asred.state.value, then it would allow me to update/edit/add/delete otherwise I could just view the record.
Thanks for any code that you could provide me.
Rey
|
|
|
 |
|