EasyCFM.COM ColdFusion Forums / Coding Help! / Restriction rights by INDIVIDUAL User!?

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Restriction rights by INDIVIDUAL User!?

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

7R4C3
02-09-2004 @ 8:37 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 32
Joined: Jan 2004

********well thats the thing, AGAIN

I, want to restrict by individual user.
so if the user logged in is viewing OWN profile
he can edit or delete. !!!but can not OTHERS!!!
right? same with threads edit or delete ure OWN
posts.
user in role only gives me the admin the permissions.
i believe i should be using GetAuthUser or sessions.USERINSESSION to set these rights not ROLES.

can someone please understand what i am saying.

pls include sample code cause i tryed with GetAuthUser and it saying the value is 0 or something, but i was logged in.

HEEEEEEEEEELP

-D

This message was edited by 7R4C3 on 2-9-04 @ 8:38 PM

MikeBam
02-09-2004 @ 8:44 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 237
Joined: Jul 2003

You can use a variation of what I said here:
http://www.easycfm.com/forums/viewmessages.cfm?Forum=12&Topic=1434&keywords=

Every user should have a unique username or user id or something. Just use that in a cfif clause.
Then you just run your db query with that information to only get their information and to only upload to their db info.

7R4C3
02-09-2004 @ 9:53 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 32
Joined: Jan 2004

thanx mike finally got it.

here is the ultimatly useful code !!!

<cfif session.USER EQ CDB.USER OR IsUserInRole("Admin")>
                    
<a href="userEDIT.cfm?ID=#ID#">
[ edit ]
</a>
                 
<a href="delete.cfm?ID=#ID#">
[ delete ]
</a>
                 
  </cfif>

sweet!!!


Website Designed and Developed by Pablo Varando.