• 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: Letting a user see only the data they should.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Letting a user see only the data they should.


  • Subject: Re: Letting a user see only the data they should.
  • From: Justin Tocci <email@hidden>
  • Date: Mon, 10 May 2004 17:45:55 -0500

Thanks Arturo. My final code looked like this

public NSArray objectsForUser() {

return EOUtilities.objectsMatchingKeyAndValue(session().defaultEditingContext() ,
"Xforecasting",
"usersname",
((Session)session()).getLogin());
}


And after a couple days of trying to figure out why it wasn't working I stumbled upon the WORepetition bindings to use with my displayGroup

item ...  xforecasting
list  ...  objectsForUser

Man this stuff is just too easy!! I looked and looked for the rest of it and I was done but just had the wrong bindings!!

Thanks again.


justin tocci fort wayne, in






On May 5, 2004, at 1:07 PM, Arturo Pirez wrote:

Well, heck that's easy! :-) Assuming you don't want sessionless (as you say above, you're using session). You do it like this:

Put the qualifying value in session using your favorite method: public ivar, get/set methods. Let's say you're using getUserRestriction()/setUserRestriction().

To get the table entries restricted to that user I would do

NSArray visibleInfo = EOUtilities.objectsMatchingKeyAndValue(session().defaultEditingContext() ,
"Table",
"username",
((Session)session()).getUserRestriction());


This you would be able to do in any WOComponent. You could even do it in WODisplayGroup if your needs are more complicated than just displaying stuff.


--arturo _______________________________________________ webobjects-dev mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Letting a user see only the data they should. (From: Justin Tocci <email@hidden>)
 >Re: Letting a user see only the data they should. (From: Justin Tocci <email@hidden>)
 >Re: Letting a user see only the data they should. (From: Arturo PĂ©rez <email@hidden>)

  • Prev by Date: Re: Catching a Database Connection failure exception?
  • Next by Date: Re: wofileupload with postgrest+hexdream
  • Previous by thread: Re: Letting a user see only the data they should.
  • Next by thread: FW: Project Builder's main window not showing source code files etc
  • Index(es):
    • Date
    • Thread