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 #2535 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

[PATCH] SecureObject doesn't proxy attributes assignments to proxied object

Reported by: xaka Owned by: Chris Arndt
Priority: normal Milestone: 1.5
Component: Identity Version: 1.1 HEAD
Severity: major Keywords:
Cc:

Description

class Root(turbogears.controllers.RootController):
  pass
root = turbogears.identity.SecureObject(Root(), turbogears.identity.not_anonymous(), ['login'])

# ... start server ...

# somewhere in code where we dinamically load something that can extend root with a new sub-controller
class MyController(turbogears.controllers.Controller)
  pass
root.sub = MyController()

After that, if you'll try to access to "/sub" you get "404 Not Found" because "sub" attribute was assigned to proxy, not proxied object as expected.

The patch and test attached.

----------------------------------------------------------------------
Ran 466 tests in 26.916s

OK

Attachments

proxy-setattr-inside-secureobject.patch Download (2.9 KB) - added by xaka 8 years ago.

Change History

Changed 8 years ago by xaka

comment:1 Changed 8 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to fixed

Applied in r7250.

comment:2 Changed 8 years ago by chrisz

  • Milestone changed from __unclassified__ to 1.5
Note: See TracTickets for help on using tickets.