Repository navigation
Conversation
Group and center bulk imports dispatch GroupCreateCommand,
CenterCreateCommand and CalendarCreateCommand through the typed
CommandDispatcher (FINERACT-2832, FINERACT-2296), which does not check
the task permission the legacy command pipeline checked per row. The
groups and centers upload endpoints are left out of the URL rules
because the import handler authorizes the rows, so any authenticated
user could create groups, centers and their meetings by import.
- GroupImportHandler / CenterImportHandler check ALL_FUNCTIONS or
CREATE_GROUP / CREATE_CENTER before reading any row. Without it, every
row not yet imported fails with "Creation failed" and an authority
message, and nothing is dispatched. A row whose group or center an
earlier run created ("Meeting failed") keeps that status and its id.
- A row with a collection meeting also needs ALL_FUNCTIONS or
CREATE_CALENDAR. Without it the group or center is created and the row
ends as "Meeting failed", as the legacy pipeline did.
- Activation and client association keep their existing checks in the
write service (ACTIVATE_GROUP, ACTIVATE_CENTER, ASSOCIATECLIENTS_GROUP).
Assisted-By: claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
JIRA: https://issues.apache.org/jira/browse/FINERACT-3242 (follow-up to #7082, which covered offices and staff)
Group and center bulk imports dispatch
GroupCreateCommand,CenterCreateCommandandCalendarCreateCommandthrough the typedCommandDispatcher(since FINERACT-2832 / FINERACT-2296). The dispatcher does not check the task permission that the legacy command pipeline checked for each row.POST /groups/uploadtemplateandPOST /centers/uploadtemplateare deliberately left out ofApiAuthorizationRules(GROUPING_ID) because the import handler is supposed to authorize the rows. Without a check there, any authenticated user could create groups, centers and their collection meetings by bulk import.Changes:
GroupImportHandler/CenterImportHandlercheckALL_FUNCTIONSorCREATE_GROUP/CREATE_CENTERonce, before any row is read. A user without the permission gets every row that is not yet imported markedCreation failed, with "User has no authority to create groups/centers" in the failure column, and nothing is dispatched. A row whose group or center was already created by an earlier run (Meeting failed) keeps that status and its id, so a later run with the permission does not create it again.ALL_FUNCTIONSorCREATE_CALENDAR. Without it, the group or center is created and the row ends asMeeting failedwith its id. This is what the legacy pipeline did, and what the handlers' existing progress levels model.ImportHandlerUtils.rejectUnauthorizedRows(...)overload for templates that report errors in a separate failure column. It counts rows throughBulkImportTemplateLayout, like FINERACT-3242: Add per-row permission checks to office and staff bulk… #7082.ACTIVATE_GROUP,ACTIVATE_CENTERandASSOCIATECLIENTS_GROUP(validateRollbackCommand).Tests:
GroupImportHandlerPermissionTestandCenterImportHandlerPermissionTest(5 each) use realRole/Permission/AppUserobjects. They cover: denied (including a malformed row, aMeeting failedrow and an already imported row),CREATE_*only,CREATE_*withoutCREATE_CALENDARfor a row with a meeting,CREATE_*plusCREATE_CALENDAR, andALL_FUNCTIONS.BulkImportPermissionTest(integration): a user without permissions uploads a group / center, the row fails and nothing is created; afterCREATE_GROUP/CREATE_CENTERis granted, the same user imports it.Locally: Spotless, checkstyle and modernizer are clean, and all
bulkimport.importhandlerunit tests pass. The integration tests compile; they run in CI.Checklist