• 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: Brian Wainwright <email@hidden>
  • Date: Fri, 11 Apr 2003 12:17:51 -0400

I had done something similar a while back.

I had a Users table,
a Security table representing various aspects of the application that users COULD have access to,
and a join table (UserSecurity) representing what security a user had access to.


Given that I'd create a new User (which you do through the display group)
But I'd also have to create a new UserSecurity Object and fetch the Security object from the database that I want to assign them access to. In the GUI I did this with a WOCheckBox - a list of available Security Levels was available to the user to select and then assign. If you're doing this programatically, then you'll have to fetch the appropriate security objects into the editing context.


Having all the appropriate objects it was simply a matter of calling addObjectToBothSidesOfRealtionshipWithKey.

User newUser = new User();
Security sec = (Security)fetchTheAppropriateSecurityObject(); //this can be done however you like
UserSecurity userSec = new UserSecurity();


userSec.addObjectToBothSidesOfRelationshipWithKey(newUser, "toUsers");
userSec.addObjectToBothSidesOfRealtionshipWithKey(sec, "toSecurity");

Also be sure you have "Propagates Primary" key turned on in your EOModel for the appropriate relationships (User.toUserSecurity() and security.ToUserSecurity())

Hope this helps.

=========================
Brian R. Wainwright
Systems Developer
Information Technology and Telecommunications
WGBH Educational Foundation
ph/fax:617.300.3450
e-mail: email@hidden

On Friday, April 11, 2003, at 09:38  AM, Jevon Hills wrote:

I'm still new a WebObjects, and do not yet fully understand what WO can
do for me.  I still tend to think like I'm writing jsp's and servlets.

My problem to day is I want to create a user in my database and give
them permissions to use a specific application.

My database has 4 tables to to this USERS, PERMISSIONS, APPLICATIONS
and the link table APPLICATIONUSERPERMISSIONS (holds each of the 3
tables id's).


I have manage to create a user using a WODisplayGroup and inserting a new object. How do I get that User permission to use a specific application.

I have not tried to flatten this relationship yet, and I know what app,
and what permission I want to give them,  I just don't know how to
create it.

Can someone help me??

My logic so far is this:
	//create a new 'empty user' by inserting A new object into a
WODisplaygroup
	//populate their data
	//save the session

What do I do next??


Jevon K. Hills Developer - Zymeta Media Promotion Systems


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/xaxhjB/hdqFAA/VygGAA/nhFolB/TM
--------------------------------------------------------------------- ~->


To unsubscribe from this group, send an email to:
email@hidden



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
_______________________________________________
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.

  • Follow-Ups:
    • Re: [webobjects-newbies] Adding a user and permissions
      • From: Jevon Hills <email@hidden>
References: 
 >Adding a user and permissions (From: Jevon Hills <email@hidden>)

  • Prev by Date: Re: PB Subprojects
  • Next by Date: Re: PB Subprojects
  • Previous by thread: Adding a user and permissions
  • Next by thread: Re: [webobjects-newbies] Adding a user and permissions
  • Index(es):
    • Date
    • Thread