Steve Kowalik has proposed merging lp:~stevenk/launchpad/less-lazr-security into lp:launchpad.
Requested reviews: Launchpad code reviewers (launchpad-reviewers) For more details, see: https://code.launchpad.net/~stevenk/launchpad/less-lazr-security/+merge/50824 Delete as much of lib/canonical/lazr as I could. The doctest is now in lazr.restful 0.17.1, and so the helper methods can die too. -- https://code.launchpad.net/~stevenk/launchpad/less-lazr-security/+merge/50824 Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/less-lazr-security into lp:launchpad.
=== removed file 'lib/canonical/lazr/debug.py' --- lib/canonical/lazr/debug.py 2009-06-25 05:30:52 +0000 +++ lib/canonical/lazr/debug.py 1970-01-01 00:00:00 +0000 @@ -1,9 +0,0 @@ -# Copyright 2009 Canonical Ltd. This software is licensed under the -# GNU Affero General Public License version 3 (see the file LICENSE). - -# Re-import code from lazr.restful until it can be refactored into a -# utility module. -__all__ = [] -import lazr.restful.debug -__all__.extend(lazr.restful.debug.__all__) -from lazr.restful.debug import * === removed file 'lib/canonical/lazr/doc/checker-utilities.txt' --- lib/canonical/lazr/doc/checker-utilities.txt 2009-04-17 10:32:16 +0000 +++ lib/canonical/lazr/doc/checker-utilities.txt 1970-01-01 00:00:00 +0000 @@ -1,73 +0,0 @@ -= Utilities to define security checkers = - -LAZR provides utility functions to make it easy to define security -checkers for content class. - -[XXX leonardr 2009-04-02 bug=354441 - This test should be moved into the same lazr module as the code it - tests, security.py (in lazr.restful as of this writing.)] - - -== protect_schema() == - -The protect_schema() function will define a checker for a class based on -the schema passed in as parameter. - - >>> from canonical.lazr.security import protect_schema - >>> from zope.interface import Attribute, Interface, implements - >>> from zope.schema import TextLine - - >>> class MySchema(Interface): - ... an_attr = Attribute(u'An attribute.') - ... - ... a_field = TextLine(title=u'A property that can be set.') - ... - ... a_read_only_field = TextLine( - ... title=u'A read only property', readonly=True) - ... - ... def aMethod(): - ... "A simple method." - - >>> class MyContent(object): - ... implements(MySchema) - ... def __init__(self, an_attr, a_field, a_read_only_field): - ... self.an_attr = an_attr - ... self.a_field = a_field - ... self.a_read_only_field = a_read_only_field - ... - ... def aMethod(self): - ... pass - ... - >>> protect_schema(MyContent, MySchema) - -By default, the defined checker will grant public access to all -attributes defined in the schema. - - >>> from canonical.lazr.debug import debug_proxy - >>> from zope.security.checker import undefineChecker, ProxyFactory - >>> content = MyContent(1, u'Mutable Field', u'RO Field') - - # ProxyFactory wraps the content using the defined checker. - >>> print debug_proxy(ProxyFactory(content)) - zope.security._proxy._Proxy (using zope.security.checker.Checker) - public: aMethod, a_field, a_read_only_field, an_attr - -The permission required can be specified using the read_permission -parameter: - - >>> undefineChecker(MyContent) - >>> protect_schema(MyContent, MySchema, read_permission='lazr.View') - >>> print debug_proxy(ProxyFactory(content)) - zope.security._proxy._Proxy (using zope.security.checker.Checker) - lazr.View: aMethod, a_field, a_read_only_field, an_attr - -If you specify a write_permission parameter, set permission will be -granted for Attribute and non-readonly fields defined in the schema. - - >>> undefineChecker(MyContent) - >>> protect_schema(MyContent, MySchema, write_permission='lazr.Edit') - >>> print debug_proxy(ProxyFactory(content)) - zope.security._proxy._Proxy (using zope.security.checker.Checker) - lazr.Edit (set): a_field, an_attr - public: aMethod, a_field, a_read_only_field, an_attr - === removed file 'lib/canonical/lazr/security.py' --- lib/canonical/lazr/security.py 2009-06-25 05:30:52 +0000 +++ lib/canonical/lazr/security.py 1970-01-01 00:00:00 +0000 @@ -1,9 +0,0 @@ -# Copyright 2009 Canonical Ltd. This software is licensed under the -# GNU Affero General Public License version 3 (see the file LICENSE). - -# Re-import code from lazr.restful until it can be refactored into a -# utility module. -__all__ = [] -import lazr.restful.security -__all__.extend(lazr.restful.security.__all__) -from lazr.restful.security import * === modified file 'versions.cfg' --- versions.cfg 2011-02-17 01:41:03 +0000 +++ versions.cfg 2011-02-22 22:42:05 +0000 @@ -33,7 +33,11 @@ lazr.delegates = 1.2.0 lazr.enum = 1.1.2 lazr.lifecycle = 1.1 +<<<<<<< TREE lazr.restful = 0.16.1 +======= +lazr.restful = 0.17.1 +>>>>>>> MERGE-SOURCE lazr.restfulclient = 0.11.2 lazr.smtptest = 1.1 lazr.testing = 0.1.1
_______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : [email protected] Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp

