refactor(profile): ask permissions instead of the rights number
Fifty-odd comparisons against users.rights become twelve permissions the profile declares.
The one that repeated ten times — 'rights < 7 hides an account awaiting confirmation' — is
users.unconfirmed.view now, and the rest name what they were actually about: editing
somebody else's profile, changing their password, resetting their settings, reading the
notes the staff keep, reading an address its owner hides, and the bans.
'Is my number bigger than theirs' was the other half of every one of those checks, and it
is the level of the roles now, next to the permission. The guards and the buttons leading
to them ask the same question at last: the Edit button appeared for a supervisor and for
an administrator strictly above the target, while the guard behind it let any holder edit
a peer, and the Delete button asked for a number the screen it leads to no longer checks.
The ban gets a shape. Which section a ban may be applied to came from matching the number
of the section against the number in users.rights — 3 was the forum because 3 was 3 — and
that mapping is now one table in BanAccess, from the kind of ban to the permission it
needs. A kind nobody declared is refused rather than allowed; the numbers 12, 14 and 16
belonged to access levels nobody documented, no form has offered them for years, and
users.ban.downloads is not declared because nothing would ever check it. How long a ban
may last follows the same permissions: a day for whoever may only ban one section, a
month for the general ban, longer for whoever may also lift one.
'Position on the Site' leaves the profile editor. It wrote users.rights directly, and
since the roles arrived that column is computed from them — the radio buttons were
writing to a mirror. The block is a link to /admin/users/{id}/roles, which is where roles
are handed out.
What is left in the module for later: the entries of the admin club count as activity by
the number, because who may enter the club is the guestbook's own check and becomes a
permission when that module is converted, and the reads of the profile owner's own rights
— the label under the nickname, the staff smilies of an old post, 'no karma for the
administration' — which need the column until stage 6 finds it a replacement.
An installation that has already run auth:apply-default-permissions needs it once more
with --force.
The one that repeated ten times — 'rights < 7 hides an account awaiting confirmation' — is
users.unconfirmed.view now, and the rest name what they were actually about: editing
somebody else's profile, changing their password, resetting their settings, reading the
notes the staff keep, reading an address its owner hides, and the bans.
'Is my number bigger than theirs' was the other half of every one of those checks, and it
is the level of the roles now, next to the permission. The guards and the buttons leading
to them ask the same question at last: the Edit button appeared for a supervisor and for
an administrator strictly above the target, while the guard behind it let any holder edit
a peer, and the Delete button asked for a number the screen it leads to no longer checks.
The ban gets a shape. Which section a ban may be applied to came from matching the number
of the section against the number in users.rights — 3 was the forum because 3 was 3 — and
that mapping is now one table in BanAccess, from the kind of ban to the permission it
needs. A kind nobody declared is refused rather than allowed; the numbers 12, 14 and 16
belonged to access levels nobody documented, no form has offered them for years, and
users.ban.downloads is not declared because nothing would ever check it. How long a ban
may last follows the same permissions: a day for whoever may only ban one section, a
month for the general ban, longer for whoever may also lift one.
'Position on the Site' leaves the profile editor. It wrote users.rights directly, and
since the roles arrived that column is computed from them — the radio buttons were
writing to a mirror. The block is a link to /admin/users/{id}/roles, which is where roles
are handed out.
What is left in the module for later: the entries of the admin club count as activity by
the number, because who may enter the club is the guestbook's own check and becomes a
permission when that module is converted, and the reads of the profile owner's own rights
— the label under the nickname, the staff smilies of an old post, 'no karma for the
administration' — which need the column until stage 6 finds it a replacement.
An installation that has already run auth:apply-default-permissions needs it once more
with --force.