dynamic rbac and roles
This commit is contained in:
@@ -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(),
|
||||
}))
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user