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 19 and Version 20 of IdentityManagement


Ignore:
Timestamp:
03/02/06 11:40:40 (9 years ago)
Author:
msarahan@…
Comment:

put in a bit on kid templates

Legend:

Unmodified
Added
Removed
Modified
  • IdentityManagement

    v19 v20  
    270270 
    271271---- 
     272 
     273== Identity and Kid templates == 
     274In addition to restricting access to methods in controller files, identity checks can also be used to limit what links(or any other element, for that matter) show up in kid templates. This is done using py:if="" statements, like so: 
     275{{{ 
     276<a py:if="'admin' in turbogears.identity.current.groups" href="/test">This is a test</a> 
     277<a py:if="'write' in turbogears.identity.current.permissions" href="/test">This is a test</a> 
     278}}} 
     279Make sure you import turbogears somewhere in your template for those identity checks to work.   
     280{{{ 
     281<?python import turbogears ?> 
     282}}} 
     283or, to save on typing,  
     284{{{ 
     285<?python from turbogears import identity ?> 
     286}}} 
     287and omit the "turbogears" part of the py:if statement. 
     288---- 
    272289=== Applying security settings, not from source code, but from configuration data === 
    273290