• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retrieve data from DB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retrieve data from DB


  • Subject: Re: Retrieve data from DB
  • From: Gilles MATHURIN <email@hidden>
  • Date: Mon, 4 Dec 2006 22:22:54 -0400

Hi,

i am quite new to WO too but it seems to me that u should use a custom class for your user in order to have direct access to its properties or so called attribute, in your case "username", "password" and "admin", so you could check with a test if the user admin attribute match to your wish …

hope this will help a little …

GM
Le 4 déc. 06 à 21:26, email@hidden a écrit :

Hi *,

I'm totally new to both, WO and this list and am unfortunately about to make a rather unglamorous debut with a complete noobie question.
I've tried to google, tried to find the information in the apple- developer-docs...all to no avail. :(


Here goes:

Inside the logic of my little login algorithm i do:

EOEnterpriseObject aUser = EOUtilities.objectMatchingValues(ec, "user", bindings);

This is all working fine and i can login when the user exists and the correct password has been given.
But I also would like to check, whether or not the user logging in is a site admin or not. For that, my 'user' entity has a third attribute (besides "username" and "password") that is "admin".
Now...from what I've read I could apparently fetch all objects from my db that have "admin = 1" and then see if my username appears anywhere in that list but this seems insanely wrong since I already have the object of interest in 'aUser'!?
So my noobness boils down to this question:


How do I get the value of the column "admin" for the EOEnterpriseObject that's stored in 'aUser'?

Thank you all for your patience with noobs like me.

-MPA


P.S. any pointers to online tutorials are more than welcome! :-)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Retrieve data from DB (From: email@hidden)

  • Prev by Date: Re: Retrieve data from DB
  • Next by Date: Best practice for exporting big data...
  • Previous by thread: Re: Retrieve data from DB
  • Next by thread: Best practice for exporting big data...
  • Index(es):
    • Date
    • Thread