Make a distinction between moderators and admins
#619
Birleştirildi
elegaanz
5 yıl önce moderator-role
içindeki 10 işlemeyi master
ile birleştirdi
Gözden Geçirenler
İnceleme iste
Değerlendirici yok
Etiketler
Etiketleri temizle
Related to the REST API
Code running on the server
Stuff related to Federation
Related to the front-end
Translations, and related code
More about project management or code than the project itself
The building, or installation process of Plume
Something isn't working
We need to talk
New feature or request
This is a new feature
Compatibility with different browsers, readers and OS
Related to an external package that Plume uses
UI/UX related issues and PRs
Good for newcomers
Extra attention is needed
Issues affecting only mobile UX
How elements're rendered out for the end user
Something else needs to be fixed first
This issue or pull request already exists
This PR is not complete yet
Issues concern a limited number of instances
This doesn't seem right
Need to be discussed by the community (on Loomio)
This PR is ready to be reviewed
Proposed ideas worth considering
This is issue has been created after a vote on Loomio
This will not be worked on
Etiketleri uygula
A: API
Related to the REST API
A: Backend
Code running on the server
A: Federation
Stuff related to Federation
A: Front-End
Related to the front-end
A: I18N
Translations, and related code
A: Meta
More about project management or code than the project itself
A: Security
Build
The building, or installation process of Plume
C: Bug
Something isn't working
C: Discussion
We need to talk
C: Enhancement
New feature or request
C: Feature
This is a new feature
Compatibility
Compatibility with different browsers, readers and OS
Dependency
Related to an external package that Plume uses
Design
UI/UX related issues and PRs
Documentation
Good first issue
Good for newcomers
Help welcome
Extra attention is needed
Mobile
Issues affecting only mobile UX
Rendering
How elements're rendered out for the end user
S: Blocked
Something else needs to be fixed first
S: Duplicate
This issue or pull request already exists
S: Incomplete
This PR is not complete yet
S: Instance specific
Issues concern a limited number of instances
S: Invalid
This doesn't seem right
S: Needs Voting/Discussion
Need to be discussed by the community (on Loomio)
S: Ready for review
This PR is ready to be reviewed
Suggestion
Proposed ideas worth considering
S: Voted on Loomio
This is issue has been created after a vote on Loomio
S: Wontfix
This will not be worked on
Etiket Yok
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
Kilometre Taşı
Kilometre taşı ayarla
Kilometre Taşlarını Temizle
Öge yok
Kilometre Taşı Yok
Atananlar
Kullanıcı ata
Atamaları Temizle
Atanan Kişi Yok
2 Katılımcı
Bildirimler
Bitiş Tarihi
Bitiş tarihi geçersiz veya aralık dışında. Lütfen 'yyyy-aa-gg' biçimini kullanın.
Bitiş tarihi atanmadı.
Bağımlılıklar
Bağımlılık yok.
Referans: Plume/Plume#619
Yeni konuda referans
Henüz bir içerik yok.
'moderator-role' Dalını Sil
Bir dalı silmek kalıcıdır. GERİ ALINAMAZ. Devam edilsin mi?
Hayır
Evet
And rework the user list in the moderation interface, to be able to run the same action on many users, and to have a huge list of actions without loosing space.
Fixes #582, fixes #359
I think we can assume an administrator is always a moderator (anyway if they are not, they can just grant themselves), so it might be more logical to have an enum user/mod/admin
(also I think UI for user edition should be a drop-down per user, with their current role as default value, and possibility to change their actual role, but I'm far from good at the whole UI thing)
(I request change for the incorrect route, the rest is more of a discussion with no strong positions)
@ -190,3 +205,3 @@
_admin: Admin,
_mod: Moderator,
page: Option<Page>,
rockets: PlumeRocket,
if I'm reading this right, and admin can't actually edit users, and a moderator can grant themselves admin rights
@ -190,3 +205,3 @@
_admin: Admin,
_mod: Moderator,
page: Option<Page>,
rockets: PlumeRocket,
Indeed.
I will try to make permissions an enum as you suggested.
For the UI part, the disadvantage of your proposal is that you can't apply the same action to a lot of users at the same time (but I don't know if it is really needed?).
@ -190,3 +205,3 @@
_admin: Admin,
_mod: Moderator,
page: Option<Page>,
rockets: PlumeRocket,
maybe for mass-ban, but probably not for mass-granting-privileges
Codecov Report
not quite a 👀
the did diff is impossible to review on mobile thanks to translations, which, too, are almost impossible to review, so i'm not sure it makes sense that we commit them as part of regular PRs
perhaps, "Author"?
I don't know, this also includes someone who made an account just to comment
For translations, I think I will remove them for the moment. Once we will switch to the 2018 edition, I think we will be able to use the latest version of
gettext-macro
which has options to make smaller diffs.sleepy 👀
that means, on this end, we'd just have a (one)
from_str()
can't we use an enum here instead of these numbers? (or in SQLite, a check constraint https://stackoverflow.com/questions/5299267/how-to-create-enum-type-in-sqlite)
See this commit message
e3ecbdb2f4
I tried to use a crate to do that with Diesel, but it generates a schema with the enum type for Postgres and with
Text
for SQlite, which we would have to maintain two differentUser
struct depending on the database, one withrole: UserRole,
and the other withrole: String,
, and I don't want to do that.Sorry, but… I don't understand. 😅 Could you try to rephrase, please?
Having an enum to make the comparison and not having magic numbers everywhere would still be cool
I didn't know it was possible to associate numbers to enum variants like that.
❓
@ -51,6 +51,12 @@ use {ap_url, Connection, Error, PlumeRocket, Result};
pub type CustomPerson = CustomObject<ApSignature, Person>;
pub enum Role {
if we
#[derive(Shrinkwrap)]
would it auto-convertas i32
?@ -51,6 +51,12 @@ use {ap_url, Connection, Error, PlumeRocket, Result};
pub type CustomPerson = CustomObject<ApSignature, Person>;
pub enum Role {
It's not a struct Role(i32), so I don't think so. Maybe tinkering with one of Deref, Borrow or AsRef can make it less verbose (like requiring only a & maybe)
An ugly but functional way of doing so would be to that:
It won't work for matching and won't protect from invalid value as effectively as an enum, but it does not require as i32
@ -51,6 +51,12 @@ use {ap_url, Connection, Error, PlumeRocket, Result};
pub type CustomPerson = CustomObject<ApSignature, Person>;
pub enum Role {
thinking about it, this is a thing, and is exactly what you hopped to do with Shinkwrap
Gözden Geçirenler
309e1200d0
olarak birleştirildi.1. Adım:
Proje deponuzdan yeni bir dala göz atın ve değişiklikleri test edin.2. Adım:
Forgejo'daki değişiklikleri ve güncellemeleri birleştirin.