Imporove datamodel
Tables now contain update_timestamp and update_process and update_timestamp will be automatically set via a trigger. Also the I removed the IDs from the tables as they are not required for the auth system. The names are the identifier.
This commit is contained in:
parent
dccfa2d4cf
commit
789981ee92
2 changed files with 49 additions and 15 deletions
|
|
@ -36,9 +36,9 @@ impl dao::PermissionDao for PermissionDaoImpl {
|
|||
async fn has_privilege(&self, user: &str, privilege: &str) -> Result<bool, dao::DaoError> {
|
||||
let result = query!(
|
||||
r"SELECT count(*) as results FROM user
|
||||
INNER JOIN user_role ON user.id = user_role.user_id
|
||||
INNER JOIN role ON user_role.role_id = role.id
|
||||
INNER JOIN role_privilege ON role.id = role_privilege.role_id
|
||||
INNER JOIN user_role ON user.name = user_role.user_name
|
||||
INNER JOIN role ON user_role.role_name = role.name
|
||||
INNER JOIN role_privilege ON role.name = role_privilege.role_name
|
||||
WHERE role_privilege.privilege_name = ? AND user.name = ?",
|
||||
privilege,
|
||||
user,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue