mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-07-25 05:20:42 +00:00
Fix managers and groups link
This PR should fix the managers and group link. Although i think there might be a cleaner sollution, there are a lot of other items to fix here which we should do in time. But for now, with theh group support already merged, this fix should at least help solving issue #2932. Fixes #2932
This commit is contained in:
parent
1b56f4266b
commit
142f7bb50d
2 changed files with 36 additions and 11 deletions
12
src/auth.rs
12
src/auth.rs
|
@ -266,7 +266,7 @@ use rocket::{
|
|||
};
|
||||
|
||||
use crate::db::{
|
||||
models::{CollectionUser, Device, User, UserOrgStatus, UserOrgType, UserOrganization, UserStampException},
|
||||
models::{Collection, Device, User, UserOrgStatus, UserOrgType, UserOrganization, UserStampException},
|
||||
DbConn,
|
||||
};
|
||||
|
||||
|
@ -558,17 +558,15 @@ impl<'r> FromRequest<'r> for ManagerHeaders {
|
|||
_ => err_handler!("Error getting DB"),
|
||||
};
|
||||
|
||||
if !headers.org_user.has_full_access() {
|
||||
match CollectionUser::find_by_collection_and_user(
|
||||
if !headers.org_user.has_full_access()
|
||||
&& !Collection::has_access_by_collection_and_user_uuid(
|
||||
&col_id,
|
||||
&headers.org_user.user_uuid,
|
||||
&mut conn,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Some(_) => (),
|
||||
None => err_handler!("The current user isn't a manager for this collection"),
|
||||
}
|
||||
{
|
||||
err_handler!("The current user isn't a manager for this collection")
|
||||
}
|
||||
}
|
||||
_ => err_handler!("Error getting the collection id"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue