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:
Group
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.
Role
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.
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?
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.
Any ideas?