Skip to content

Consider adding some form of user group support #16

@dankrause

Description

@dankrause

Currently, our permission system has the following types of permission for a given operation on a given model:

PERMISSION_ANYONE
PERMISSION_LOGGED_IN_USER
PERMISSION_OWNER_USER
PERMISSION_ADMIN

This means that there is currently no built-in way to, for example, grant one non-admin user the ability to create an instance of a given model, but deny another non-admin user the same permission.

It would be possible for a rest_gae user to implement their own group system using a custom user model, and tying into the callbacks we provide. We may decide that this is acceptable, and any direct support for groups is out of scope for this project. In that case, this issue can be closed with no action taken.

It would also be possible to add some set of features that would either fully implement a working group system, or make it easier to implement one.

Here are some features that a user would expect of a full group system:

  • The ability to assign one or more groups to a user
  • The ability to set a default group for a self-created user
  • The ability to assign a permission similar to PERMISSION_GROUP['foo', 'bar']
  • The ability to limit which users can assign particular groups to other users

Here are some features that, if implemented, would ease user development of a group system, without actually implementing one:

  • A PERMISSION_CUSTOM permission that would result in a callback to decide if permission is granted to access an object. Not sure how this would work with building queries.
  • Defining a Permission base class that is used instead of constants. Each existing permission would subclass Permission, and we'd move some logic into it's methods. Users would provide their own subclasses. This would be an alternative to using callbacks. I haven't thought this one through, so I don't know what the implementation would look like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions