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

Changes between Version 56 and Version 57 of IdentityManagement


Ignore:
Timestamp:
04/28/06 00:31:37 (13 years ago)
Author:
fredlin
Comment:

add prompt statement

Legend:

Unmodified
Added
Removed
Modified
  • IdentityManagement

    v56 v57  
    33    '''NOTE''' 
    44 
    5     This page describes the setup for versions after SVN revsion 1108 and released versions > 0.9a4.  There were changes to make identity PEP 8 compatible. 
     5    This page describes the setup for released versions > 0.9a4.   
    66 
    77    For prior versions: change "user_name", "group_name" and "permssions_name" to "userId", "groupId" and "permissionsId", respectively.  Also change "display_name" and "email_address" to "displayName" and "emailAddress. 
    88 
    99The TurboGears identity management architecture was originally designed and written by [http://metrocat.org/nerd/2005/10/identity-management-for-turbogears Jeff Watkins]. 
     10 
     11Here is a Tutorial for getting TurboGears identity management support up and running. It consists of 3 parts: 
     12 
     13[[PageOutline(1-2,,inline)]] 
     14 
     15This Tutorial is written from the perspective of a fresh quick-started project, but almost everything applies for existing projects as well. 
     16 
     17= Part I: Identity Basics = 
     18 
     19== A. Quick-Start == 
     20 
     21To begin with the tutorial, let's quick-start a learning project. Of course, everything you learn in the tutorial applies to existing projects as well. 
     22{{{ 
     23#!python 
     24$ tg-admin quickstart  
     25}}} 
     26 
     27Name your project "identity_tutorial" and set the database uri in "identity_tutorial/dev.cfg" to point to a server and database you want to use. 
     28Refer to the [http://www.turbogears.org/docs/wiki20/ Wiki in 20 Minutes Tutorial] for details. 
     29 
     30After you specified the project name. a identity prompt will pop up: 
     31 
     32{{{ 
     33Do you need Identity (usernames/passwords) in this project? [no] 
     34}}} 
     35 
     36We wants identity so we type "yes", then we can select one of providers:  
     37 
     38{{{ 
     39Select your provider sqlobject or sqlalchemy [sqlobject]: 
     40}}} 
     41 
     42then the identity classes are generated in "controller.py" and "model.py" as other classes.  
     43 
     44 
     45== B. Setting up Identity == 
    1046 
    1147Identity Management can be used in controllers and in templates: 
     
    1349 * In ''templates'' to adapt the appearance depending on the user's identity 
    1450 
    15 Here is a Tutorial for getting TurboGears identity management support up and running. It consists of 3 parts: 
    16  
    17 [[PageOutline(1-2,,inline)]] 
    18  
    19 This Tutorial is written from the perspective of a fresh quick-started project, but almost everything applies for existing projects as well. 
    20  
    21 To begin with the tutorial, let's quick-start a learning project. Of course, everything you learn in the tutorial applies to existing projects as well. 
    22 {{{ 
    23 #!python 
    24 $ tg-admin quickstart  
    25 }}} 
    26 Name your project "identity_tutorial" and set the database uri in "identity_tutorial/dev.cfg" to point to a server and database you want to use. 
    27 Refer to the [http://www.turbogears.org/docs/wiki20/ Wiki in 20 Minutes Tutorial] for details. 
    28  
    29 = Part I: Identity Basics = 
    30  
    31 == A. Setting up Identity == 
     51To take advantage of identity, we need enable it. 
    3252 
    3353=== Step 1: Enabling Identity === 
     
    111131Click the expansion triangle in front of "groups". This will reveal a "Manage Relations" link. Click on it. CatWalk will display two lists. Select the new user on the right list and click on "Add Selected" to move it to the left list. Then click "Save" to confirm the change. 
    112132 
    113 == B. Using Identity in the Controller == 
     133== C. Using Identity in the Controller == 
    114134 
    115135If you want to protect any method, add an {{{@identity.require(...)}}} decorator to the method. This decorator has a single argument, the ''predicate'', which specifies the conditions to check. The identity module provides many predicates that you can use. 
     
    129149Note that identity has added a small "Welcome, Jane Doe. Logout" at the top of the page. 
    130150 
    131 == C. Identity Predicates == 
     151== D. Identity Predicates == 
    132152 
    133153=== Single Permission Checks ===