add: user secondary permission
This commit is contained in:
parent
339aa59434
commit
9528d71b2a
6 changed files with 128 additions and 95 deletions
|
@ -3,6 +3,7 @@ use oiseau::cache::Cache;
|
|||
use crate::model::auth::UserConnections;
|
||||
use crate::model::moderation::AuditLogEntry;
|
||||
use crate::model::oauth::AuthGrant;
|
||||
use crate::model::permissions::SecondaryPermission;
|
||||
use crate::model::{
|
||||
Error, Result,
|
||||
auth::{Token, User, UserSettings},
|
||||
|
@ -46,6 +47,7 @@ impl DataManager {
|
|||
grants: serde_json::from_str(&get!(x->19(String)).to_string()).unwrap(),
|
||||
associated: serde_json::from_str(&get!(x->20(String)).to_string()).unwrap(),
|
||||
invite_code: get!(x->21(i64)) as usize,
|
||||
secondary_permissions: SecondaryPermission::from_bits(get!(x->7(i32)) as u32).unwrap(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,7 +226,8 @@ impl DataManager {
|
|||
&"",
|
||||
&serde_json::to_string(&data.grants).unwrap(),
|
||||
&serde_json::to_string(&data.associated).unwrap(),
|
||||
&(data.invite_code as i64)
|
||||
&(data.invite_code as i64),
|
||||
&(SecondaryPermission::DEFAULT.bits() as i32),
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -19,5 +19,6 @@ CREATE TABLE IF NOT EXISTS users (
|
|||
connections TEXT NOT NULL,
|
||||
stripe_id TEXT NOT NULL,
|
||||
grants TEXT NOT NULL,
|
||||
associated TEXT NOT NULL
|
||||
associated TEXT NOT NULL,
|
||||
secondary_permissions INT NOT NULL
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue