Browse Source
post_bulk_access_collections authorized each requested collection via the legacy Collection::is_manageable_by_user helper, which also accepts a member's membership/group access_all. For a Custom member this diverged from the single-collection edit endpoint (ManagerHeaders -> collection_edit_access), which requires a real per-collection Manage grant and never treats a Custom member's access_all as one. A flagless Custom member placed in an access_all group could therefore rewrite collection user/group assignments in bulk while the single-collection edit endpoint denied the exact same change. Add auth::can_edit_collection - the collection_edit_access + can_manage_collection pair the ManagerHeaders guard already uses - and call it per collection in the bulk-access endpoint. Legacy Managers, Admins/Owners and Edit-any-collection members are unaffected; only a Custom member's access_all shortcut is removed, so bulk-access now enforces exactly what the single-collection edit endpoint does.pull/7397/head
2 changed files with 28 additions and 8 deletions
Loading…
Reference in new issue