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:
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'.
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:
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:
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 justSELECT * FROM users WHERE permissions >= 'donator'.