From fd837776e2aaf30f4ea973d65c9dfe0979988371 Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Wed, 31 Jul 2024 09:26:09 -0700 Subject: [feature] Implement Mastodon-compatible roles (#3136) * Implement Mastodon-compatible roles - `Account.role` should only be available through verify_credentials for checking current user's permissions - `Account.role` now carries a Mastodon-compatible permissions bitmap and a marker for whether it should be shown to the public - `Account.roles` added for *public* display roles (undocumented but stable since Mastodon 4.1) - Web template now uses only public display roles (no user-visible change here, we already special-cased the `user` role) * Handle verify_credentials case for default role * Update JSON exact-match tests * Address review comments * Add blocks bit to admin permissions bitmap --- web/template/profile.tmpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/template/profile.tmpl b/web/template/profile.tmpl index adeb83f3e..bf58d660b 100644 --- a/web/template/profile.tmpl +++ b/web/template/profile.tmpl @@ -173,9 +173,11 @@
Username
@{{- .account.Username -}}@{{- .instance.AccountDomain -}}
- {{- if and (.account.Role) (ne .account.Role.Name "user") }} + {{- if .account.Roles }}
Role
-
{{- .account.Role.Name -}}
+ {{- range .account.Roles }} +
{{- .Name -}}
+ {{- end }} {{- end }} -- cgit v1.3