• 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: [webobjects-newbies] Adding a user and permissions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [webobjects-newbies] Adding a user and permissions


  • Subject: Re: [webobjects-newbies] Adding a user and permissions
  • From: Arturo PĂ©rez <email@hidden>
  • Date: Fri, 11 Apr 2003 15:58:53 -0400

On Friday, April 11, 2003, at 12:56 PM, Jevon Hills wrote:

I'm trying to create a USER and give them PERMISSIONS on an APPLICATION. In the old way I'd just grab their id's and use those, but I'd like to try to use EOModeler to handle that for me.


This is a slightly tricky kind of thing and one of the reasons I don't use flattened relationships (although I understand the benefits).

Let's say you don't flatten ApplicationUserPermission. Furthermore, say you make a relationship
from ApplicationUserPermission to Application. Finally, say you also make a relationship from
ApplicationUserPermission to User.


In that case you do something like (off the top of my head)

appUserPerm = new AppUserPerm();
ec.insertObject(appUserPerm);
appUserPerm.addObjectToBothSidesOfRelationshipWithKey("toApplication", applicationObject);
appUserPerm.addObjectToBothSidesOfRelationshipWithKey("toUser", userObject);
appUserPerm.addObjectToBothSidesOfRelationshipWithKey("toPermission", permissionObject);



The above may seem a little strange because you've kind of promoted the join table into one the
most important entity. There are some nice benefits to the above although most would probably see
them as minor benefits. Straightforward creation of permission and application centric fetch specs,
for example.
_______________________________________________
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: [webobjects-newbies] Adding a user and permissions (From: Jevon Hills <email@hidden>)

  • Prev by Date: Re: java.lang.OutOfMemoryError
  • Next by Date: Re: PB Subprojects
  • Previous by thread: Re: [webobjects-newbies] Adding a user and permissions
  • Next by thread: java 1.4 solaris memory issue
  • Index(es):
    • Date
    • Thread