pinax / pinax-teams

an app for Django sites that supports open, by invitation, and by application teams
MIT License
49 stars 36 forks source link

Enable apps to be team aware #3

Open paltman opened 10 years ago

paltman commented 10 years ago

On Team Aware Apps

With pinax-teams giving us a beachhead for team-based web applications, it is important for us to consider how to make our Django apps easily used within this team context. How do we make them team aware without sacrificing the loose coupling that makes Django apps so great?

I have some ideas specifically around the integration of pinax-wiki with teams that I'd like to explore and propose.

App Level Roles

It's easy to conflate team management roles with site-level and app-level roles. To be clear, the roles on the Membership model in pinax-teams is solely for the management of team membership.

To make pinax-teams extra powerful would be to be extensible so that if team aware apps were in INSTALLED_APPS, extra interface would appear on the team management page that allowed a Manager of the team to set the roles for the different apps that are installed.

Groups

We could have the following models added to pinax-teams:

Group:
    label

GroupRole:
    group
    label

GroupMembership:
    group
    team
    user
    role

In the initialization code for pinax-teams we can loop over the INSTALLED_APPS and import any groups.py module and execute an install() method if it exists. This will basically do get_or_create's on Group and GroupRole to install the data that this app will need.

The presence of these groups and inform the UI on the team management pages, perhaps tabs for each Group found, with the ability to add/edit/delete members from the different groups.

Hooksets

In each app that is going to be made team aware and is providing the contracted groups.py module and install() method, a default hookset will be defined so that default interpretation of security could be provided but also so that one could easily override this at the site level.