myxce/src/frontend/apiserver/models
Rongsong Shen 4a38bb3ca9
fix(apiserver): enforce self_ug job scopes and accept project filters (bug-1934, bug-1935)
bug-1934: every job-permission check read a single scope and compared it
only with "self", so a job:view or job:control grant scoped to self_ug acted
like "all" (list, get by ID, control), and self + self_ug collapsed to self.
userJobScope() now collects all of a user's grants of a job permission
before deduplication and adds them up (all; self; self_ug = the user and
everyone sharing a user group). The job list appends a submit_user filter
for narrower scopes, get-by-ID keeps covered rows in a new slice (removing
from the ranged slice skipped rows) and answers 403, both control paths
and job output check the owner against the scope. User groups now reach
the apiserver: the config push converts cluster_config_t.ugroups and
OnUserGroupsUpdated() replaces the new store (nested groups, all,
exclusions). The default basic_user now also sees its user-group mates'
jobs, as its configuration says.

bug-1935: project_name and license_project are accepted job filters, so
xcecli jobs list -P works.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 06:56:57 +00:00
..
apikey.go Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
auth.go Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
clusters.go Add HostConfig + Cluster fields to models and update docs 2026-04-16 09:24:22 +00:00
clusters_test.go style(frontend): gofmt the apiserver and xcecli sources 2026-10-02 09:33:16 +00:00
common.go style(frontend): gofmt the apiserver and xcecli sources 2026-10-02 09:33:16 +00:00
files.go Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
hosts.go style(frontend): gofmt the apiserver and xcecli sources 2026-10-02 09:33:16 +00:00
hosts_test.go style(frontend): gofmt the apiserver and xcecli sources 2026-10-02 09:33:16 +00:00
jobs.go fix(apiserver): enforce self_ug job scopes and accept project filters (bug-1934, bug-1935) 2026-10-10 06:56:57 +00:00
jobs_test.go feat: P2.5-7a map JOB_STAT_TRANSIENT (0x400) to TRANSIENT in job status API 2026-05-08 02:03:19 +00:00
queues.go Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
resources.go style(frontend): gofmt the apiserver and xcecli sources 2026-10-02 09:33:16 +00:00
roles.go Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
usergroups.go fix(apiserver): enforce self_ug job scopes and accept project filters (bug-1934, bug-1935) 2026-10-10 06:56:57 +00:00
users.go Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00