Skip to content

Gate job submission on managed status (JobRoutes.submitClubJob) #177

Description

@Sootopolis

Job submission resolves the club via Club.selectBySlug and never consults managed_club (JobRoutes.scala:428-435; recruitment at :143-144). No route outside ManagedClubRoutes references managed status.

Consequence: any club row CCAS has ever ingested — including thousands of opponent and scouted clubs — is a submittable job target, and an unmanaged club runs exactly like a managed one.

This was previously framed as future abuse control (central-DB storage cost). The stale-current_club case in #174 makes it a correctness issue today: after ccas club remove <slug>, the bare/current_club path still runs jobs against the removed club while --all correctly excludes it. Same club, two sibling targeting modes, opposite results.

Proposal: in JobRoutes.submitClubJob, after Club.selectBySlug succeeds, check ManagedClub.selectByClubId and return Club <slug> is not managed; add it with 'ccas club add <slug>' when absent. Apply to the recruitment handler too.

Collapses the --all vs current_club divergence to one enforcement point with no extra round-trip.

Biggest behavioural change of the club-CLI batch — filed separately from #174 so the CLI-side auto-clear can land first. Needs a decision on whether scouting an unmanaged club should stay possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:serverBackend HTTP server, jobs, schedulerenhancementNew feature or requestpending-decisionWaiting on a direction to be chosen

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions