Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #695 (closed enhancement: wontfix)

Opened 13 years ago

Last modified 12 years ago

add an identity command to create a user account

Reported by: fredlin Owned by: anonymous
Priority: normal Milestone: 0.9a5
Component: Identity Version:
Severity: normal Keywords: identity command
Cc:

Description

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="jeff@metrocat.org",
            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()
>>>

Change History

comment:1 Changed 13 years ago by godoy

Is the CatWalk alternative available in the wiki good enough (http://trac.turbogears.org/turbogears/wiki/IdentityManagement)?

The problem for a command like this is that you're thinking about only one identity provider. Mandatory fields are different for a SQL record and a LDAP entry, for example.

comment:2 Changed 13 years ago by fredlin

  • Status changed from new to closed
  • Resolution set to wontfix
  • Milestone set to 0.9a5

Yes, Catwalk is ok.

Note: See TracTickets for help on using tickets.