views:

400

answers:

1

In followup to an earlier question, I'd be interested to know whether anyone can recommend some open-source Python-based Google App Engine projects with complex user-role-permission models to consult as a reference. A link to the code would be nice.

In my own project, I'd like to add a layer of organizations in addition to the usual roles and permissions, e.g., users are members of one ore more organizations, and their roles are relative to the organizations. A lot like an issue tracker where there is a many-to-many relationship between users and projects.

+2  A: 

App-Engine-Patch ports the django permission model over to AppEngine. Scroll down to the Permissions section of this page: http://code.google.com/p/app-engine-patch/wiki/GettingStarted. The source code is available from that site as well.

dar
Thank you for the helpful response. In addition to simple permissions, I was also hoping to find actual persistable models that use things like the Django permissions, but go beyond them to do more complex things. In this case I'd like to allow organizations to assign non-system-wide permissions, and I'm trying to figure out how to create the denormalized relationships that will allow things like search results over items that have different levels of visibility.
Eric W.
Sounds like a shared schema multitenent approach. I've not looked for any permission frameworks, but I'd be interested to hear if there are any out there. A simple way to do it is to add a company code to each model, and use queryset filters and view decorators which check the company code when viewing/retrieving the data.
dar