R-a-dio / site

R/a/dio's site, open-sourced.
https://r-a-d.io
MIT License
145 stars 19 forks source link

Redo permission system #98

Closed Bevinsky closed 5 years ago

Bevinsky commented 5 years ago

The single integer permission system is insufficient.

Currently, the permissions are as follows:

This should be replaced with something more fine grained, represented by a pivot and definition table.

The definition table is named 'permission_kinds'. It has 1 column.

The pivot is named 'permissions'. It has 3 columns.

A suggested list of permissions follows.

Wessie commented 5 years ago

this look okay, we currently have 3 bits of code that touch these permissions so each one of them would have to be adjusted

Bevinsky commented 5 years ago

That's right, should mention which those are:

Those are what you meant, right?

Wessie commented 5 years ago

they would be

old hanyuu does not actually use permissions for anything

Bevinsky commented 5 years ago

Oh, right.

I'm planning to keep a stopgap by setting the old permission number for certain cases still, so anything that uses it will still work until it's updated.

Bevinsky commented 5 years ago

Halfway implemented now, only thing left is to adapt the database and pending pages + navbar to properly use the new subpermissions.

Bevinsky commented 5 years ago

Done in 3ee2ec9f8747e7815b6a03934a8cfa8d2b51671e.