~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to doc/security.txt

  • Committer: Jonathan Lange
  • Date: 2011-02-16 12:46:56 UTC
  • mto: This revision was merged to the branch mainline in revision 12394.
  • Revision ID: jml@canonical.com-20110216124656-6e757xi16xrkggr5
Fix restructured text errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
1. Define the adapter in lib/canonical/launchpad/security.py. Here's a simple
40
40
example of an adapter that authorizes only an object owner for the
41
 
launchpad.Edit permission on objects that implement the IHasOwner interface:
 
41
launchpad.Edit permission on objects that implement the IHasOwner interface::
42
42
 
43
43
    class EditByOwner(AuthorizationBase):
44
44
        permission = 'launchpad.Edit'
54
54
 
55
55
2. Declare the permission on a given interface in a zcml file. So, for the
56
56
above adapter, here's how it's hooked up to IProduct, where IProduct is
57
 
protected with the launchpad.Edit permission:
 
57
protected with the launchpad.Edit permission::
58
58
 
59
59
    <class
60
60
        class="lp.registry.model.product.Product">