Skip to content

feat(rdm): mixed file restriction splitting + community roles checks - #662

Merged
zzacharo merged 2 commits into
CERNDocumentServer:masterfrom
palkerecsenyi:mixed-file-restrictions
Nov 13, 2026
Merged

zzacharo merged 2 commits into
CERNDocumentServer:masterfrom
palkerecsenyi:mixed-file-restrictions

Conversation

@palkerecsenyi

@palkerecsenyi palkerecsenyi commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Closes #659

  • Access, owners and grants now come from the dump's restrictions key instead of MARC fields, with typed helpers in restrictions.py
  • Records with mixed public/restricted files are split into a public record and a restricted record. This generalises the EP-approval split into RecordSplitStrategy (EP and plain mixed restriction strategies)
  • Records with more than one distinct restricted file status still need manual import and an exception is raised for them.
  • New CommunityMembersCheck logs a warning when the target communities' members don't cover the legacy collection or edit roles. Records in more than one restricted collection need manual import
  • Raises an exception when trying to add a public record to a restricted community
  • Removed the access_grants_view flag and AccessGrantsMapper, and updated tests and fixtures
  • New unit tests and changes to existing ones (e.g. adding the restrictions key to the example dumps)

@palkerecsenyi
palkerecsenyi force-pushed the mixed-file-restrictions branch 19 times, most recently from 4dd262a to 297295e Compare November 3, 2026 13:09
@palkerecsenyi palkerecsenyi changed the title WIP: mixed file restriction splitting + community roles checks feat(rdm): mixed file restriction splitting + community roles checks Nov 3, 2026
@palkerecsenyi
palkerecsenyi marked this pull request as ready for review November 3, 2026 13:09
@palkerecsenyi
palkerecsenyi force-pushed the mixed-file-restrictions branch from 297295e to 52fc070 Compare November 3, 2026 15:55
@palkerecsenyi
palkerecsenyi force-pushed the mixed-file-restrictions branch from 52fc070 to 7821574 Compare November 4, 2026 08:58
@palkerecsenyi

palkerecsenyi commented Nov 4, 2026 •

Copy link
Copy Markdown
Member Author
  • The community checks should be a report, it cannot be a per-record warning or error. Otherwise we will ignore it or bypass it all the time.
    • Community members comparison should be in this report
    • This is a blocker
  • Consolidate the access checks and gratns, move most of it into the transform step
  • Restricted collections should be mapped as access grants instead of community-level membership checks. We are migrating multiple restricted and non-restricted collections into one single community.
    • For now, raise if migrating restricted collection record into public community
    • Check ongoing migrations if this is a blocker
  • Rearrange the fields on the dump: move the relevant keys into their respective entities (files, comments, record)
    • Comments to move to the comments dump
    • Don't do too much of this for now, not a blocker
  • Remove the any_collection edit from the restrictions dump
  • The file restrictions should only be the roles
  • 270__m field is not owners, we need to check
    • It is maybe jsut a contact person
    • Shouldn't base access grants off of this
    • At least not yet, we need to understand what this is doing (e.g. ATLAS-specific functionality)
    • Don't use it for now

@palkerecsenyi
palkerecsenyi force-pushed the mixed-file-restrictions branch 4 times, most recently from ce89bcb to 9d560d7 Compare November 12, 2026 12:49
@palkerecsenyi
palkerecsenyi force-pushed the mixed-file-restrictions branch from 9d560d7 to 9c2383d Compare November 12, 2026 13:10
@palkerecsenyi

Copy link
Copy Markdown
Member Author

Further changes to this code will be made in #684. This PR will be merged to unblock the migration

@zzacharo
zzacharo merged commit 458aece into CERNDocumentServer:master Nov 13, 2026
3 checks passed
@palkerecsenyi
palkerecsenyi deleted the mixed-file-restrictions branch November 13, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mixed file restriction - split records to public and restricted

2 participants