Re: [webobjects-newbies] Adding a user and permissions
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.