roles i can invent

September 10, 2026 admindevloggo

roles i can invent

The permission system got the last piece I wanted. Since the RBAC rework the site has had a capability matrix I can edit, which role can moderate comments, which can see the user list, all of it toggleable. But the roles themselves were carved in stone: user, moderator, dev, admin, take it or leave it. Want a "junior moderator"? Tough, go write code.

Now roles are just data. The permissions page shows them as a ladder, user pinned at the bottom, admin pinned at the top, and I can create a new role anywhere in between, rename it, move it up and down, or delete it. Position on the ladder is rank, and rank is what decides who can act on whom, so dragging a role above moderator literally means moderators can no longer touch its holders. A new role starts with zero permissions until I toggle some on, which felt like the only sane default.

The part I actually spent care on was deletion. Deleting a role someone holds asks me to confirm with the exact number of people holding it, then drops them all back to plain user. And the tokens those people are still walking around with? A session token naming a role that no longer exists gets nothing at all, the whole system treats unknown roles as rank zero with no permissions. I tested that specific case, made a role, gave someone a token with it, deleted the role, replayed the token: 403. That is the boring kind of test that lets me sleep.

Small bonus fix while in there: the rule that only higher ranks can edit usernames and emails used to check for the role literally named "dev". Since dev can now be renamed, that check compares ladder positions instead of names. Names are labels now, the ladder is the truth.

0 comments

Log in to comment.

Log in

Forgot password?

No account?