mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-26 03:46:47 +02:00
Return stored manage flag for groups in collections/details (#7795)
CollectionGroup::to_json_details_for_group derived manage from !read_only && !hide_passwords, so the group permission "Can edit items" was reported as "Can manage collection" by collections/details, while groups/<id>/details reported the stored value. Saving the collection access dialog in the web vault then persisted manage=true. Fixes #7794 Co-authored-by: Alexander Widak <deltatree.widak@gmail.com>
This commit is contained in:
1 parent
c925c04de0
commit
7ce705be56
1 file changed
+5
-5
@@ -137,15 +137,15 @@ impl CollectionGroup {
|
||||
}
|
||||
|
||||
pub fn to_json_details_for_group(&self) -> Value {
|
||||
// If both read_only and hide_passwords are false, then manage should be true
|
||||
// You can't have an entry with read_only and manage, or hide_passwords and manage
|
||||
// Or an entry with everything to false
|
||||
// For backwards compatibility and migration proposes we keep checking read_only and hide_password
|
||||
// Return the stored manage flag. Deriving it from !read_only && !hide_passwords turned the group
|
||||
// permission "Can edit items" (readOnly=false, hidePasswords=false, manage=false) into "Can manage"
|
||||
// in GET /organizations/<org>/collections/details, while GET /groups/<id>/details reported the stored
|
||||
// value. Saving the collection access dialog then persisted manage=true.
|
||||
json!({
|
||||
"id": self.groups_uuid,
|
||||
"readOnly": self.read_only,
|
||||
"hidePasswords": self.hide_passwords,
|
||||
"manage": self.manage || (!self.read_only && !self.hide_passwords),
|
||||
"manage": self.manage,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user