Skip to content

Fix creating a batch of agents across divisions with the QueryComboBox#7802

Draft
acwhite211 wants to merge 4 commits intomainfrom
issue-2405-new
Draft

Fix creating a batch of agents across divisions with the QueryComboBox#7802
acwhite211 wants to merge 4 commits intomainfrom
issue-2405-new

Conversation

@acwhite211
Copy link
Member

@acwhite211 acwhite211 commented Mar 12, 2026

Fixes #2405

Fixed a few issues found when creating a batch of agents across divisions with the QueryComboBox.

Fixed cross-division Agent creation from the QueryComboBox. New resources were defaulting to the logged-in collection’s scope, which caused agents created in the popup to land in the wrong division. When forceCollection is set, new Agent records are explicitly scoped to that target collection’s division.

Use scoped creation for both “+” and typed-create paths. Search was correctly using forceCollection, but creation path wasn’t. Create behavior now matches search scoping.

The agent already set in the new Specify user form was blank when opening the “Set User Agents” dialog box opened. I made a change to ensure that the division that the user was set to, via the collection it was assigned to, defaults to that value in the QueryComboBox.

Lastly, I went through to find where in both the front-end and back-end where a user was assumed to just have one agent. Where those instances were found, a solution of considering the user having multiple agents was addressed. In addition to this, the security of a user having permission to add/access agents in different divisions was also validated.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests
  • Add a reverse migration if a migration is present in the PR

Testing instructions

  • Use a database with multiple divisions.
  • Go to the "Security and Accounts Page".
  • Create a new Specify user in the institution.
  • Choose a collection that resides in a different division than the division of the currently logged-in collection.
  • Select "Institution Admin".
  • Create a new Agent.
  • Set the "User Group" to "Manager".
  • Click the "Save" button.
  • See that the "Set User Agents" window appears, and the QueryComboBox for the division of the collection set for the user is already defaulted to the new agent.
  • Add new agents using the QueryComboBox for each division.
  • Click the "Save" button for the "Set User Agents" window.
  • Click the "Save" button to create the new Specify user.
  • Check the database to see all the new agents got created for each of the divisions.
SCR-20260311-nukq SCR-20260311-nvhp SCR-20260311-nvts SCR-20260311-nxjv SCR-20260311-nxrc SCR-20260311-nxvg SCR-20260311-nyfw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Cannot set batch of agents for collection access

1 participant