#695: add an identity command to create a user account
-------------------------+--------------------------------------------------
 Reporter:  fredlin      |       Owner:  anonymous       
     Type:  enhancement  |      Status:  new             
 Priority:  normal       |   Milestone:                  
Component:  Identity     |     Version:                  
 Severity:  normal       |    Keywords:  identity command
-------------------------+--------------------------------------------------
 Add an identity command to create a user account, just like Django does.
 http://www.djangoproject.com/documentation/tutorial2/

 Warp the commands
 {{{

 $ tg-admin identity createuser
 Enter userId:
 Enter emailAddress:
 Enter displayName:
 Enter password:

 $ tg-admin identity creategroup
 Enter groupId:
 Enter displayName:

 $ tg-admin identity assignpermission
 Enter userId:
 Enter groupId: //(or displayName)

 }}}

 This enhancement is related to #601.

 ----

 createuser warp
 {{{
 >>> from turbogears.identity.soprovider import *
 >>> hub.begin()
 >>> u=TG_User( userId="jeff", emailAddress="[EMAIL PROTECTED]",
             displayName="Jeff Watkins", password="xxxxx" )
 >>> hub.commit()
 >>>
 }}}

 creategroup wrap
 {{{
 >>> from turbogears.identity.soprovider import *
 >>> hub.begin()
 >>> g=TG_Group( groupId="admin", displayName="Administrators" )
 >>> hub.commit()
 >>>
 }}}

 assignpermission wrap
 {{{
 >>> from turbogears.identity.model.somodel import *
 >>> hub.begin()
 >>> u=TG_User.select(TG_User.q.userId=="jeff")
 >>> g=TG_Group.select(OR(TG_Group.q.groupId=="foo",
                          TG_Group.q.displayName=="foo"))
 >>> u.addTG_Group(g)
 >>> hub.commit()
 >>>
 }}}

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/695>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to