Skip to content

Permission stratification #64

Description

@nic-hartley

BLOCKED until #18 is done

Goal

We currently have users and admins. We'll probably need more detailed levels of authorization to enable some of the other features.

Description

Currently, just having user/admin is fine, but to implement things like #62 and (potentially) giving donors more access than normal users we'll need to implement multiple layers, rather than just a boolean restricted/not.

I think at least four layers will be necessary:

  • User
  • Donator
  • Mod
  • Admin

What, exactly, each of these users can do is up for discussion, hence the tag.

Also worth noting is that any "greater" level can do everything that the lower levels can do, so a mod can implicitly do everything a donator can, whether or not they've actually donated.

Additional notes

This can probably done with:

enum PermissionLevels {
  USER,
  DONATOR,
  MOD,
  ADMIN
}
CREATE TYPE permission AS ENUM ('user', 'donator', 'mod', 'admin');

The order is important -- in PostgreSQL, values later in the list compare as > than values earlier in the list. As a trivial example, getting all people with donator privileges or above is just SELECT * FROM users WHERE permissions >= 'donator'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussion wantedWe need to talk about thisfeatureSomething should be added

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions