dynamic rbac and roles

This commit is contained in:
Priec
2026-08-09 12:56:57 +02:00
parent 29ccd8d2d7
commit 4d6c18988b
10 changed files with 630 additions and 27 deletions

View File

@@ -31,7 +31,6 @@ pub(crate) async fn register(
email: input.email.trim().to_string(),
password: input.password.trim().to_string(),
password_confirmation: input.password_confirmation.trim().to_string(),
role: input.role.trim().to_string(),
timezone: timezone.clone(),
phone_country: phone_country.clone(),
}))

View File

@@ -12,8 +12,6 @@ pub(crate) struct RegisterInput {
#[serde(default)]
pub password_confirmation: String,
#[serde(default)]
pub role: String,
#[serde(default)]
pub timezone: String,
#[serde(default)]
pub phone_country: String,

View File

@@ -6,8 +6,6 @@
//! The client filters these itself as the field is typed into; here the lists
//! ship whole in `<datalist>` elements and the browser does the filtering.
pub(crate) const ROLES: &[&str] = &["admin", "moderator", "accountant", "viewer"];
pub(crate) fn timezones() -> Vec<String> {
jiff::tz::db()
.available()

View File

@@ -12,7 +12,6 @@ use super::suggestions;
#[template(path = "pages/register/register.html")]
struct RegisterPage {
nav: Nav,
roles: &'static [&'static str],
timezones: Vec<String>,
phone_countries: Vec<String>,
}
@@ -20,7 +19,6 @@ struct RegisterPage {
pub(crate) fn render_page(nav: Nav) -> String {
render(&RegisterPage {
nav,
roles: suggestions::ROLES,
timezones: suggestions::timezones(),
phone_countries: suggestions::phone_countries(),
})