title: MVC custom groups for authorization
body: <p>I've done some searching but it doesn't look like a very commonly-asked or answered question. I need to implement a custom group authorization policy in an MVC application I am developing. It sort of follows the "classic" example:</p>
  
  <p><strong>Group</strong></p>
  
  <p>A user can create a group. A group exists as an object in a database with an Id, Name, and, among other things, a List of Users who belong to this group.</p>
  
  <p><strong>Role</strong></p>
  
  <p>A user can hold a role in many groups. For example, the creator of the group instantly becomes the administrator of the group. Different roles can access different things within the group.</p>
  
  <p>I know it's very easy with pre-defined groups, but what about when I want to make the groups dynamic and each group be an object in the database?</p>
  
  <p>A simple example of this in the real world would be groups on facebook, which have Admins, moderators, content-creators, etc. And only members can see them, edit them, or post to them.</p>
  
  <p>Any ideas?</p>