Add a restart-jobs role

[?]
Dec 30, 2017, 1:28 PM
JO75HQLOPQKFJ4PGB4R3RMOR5A4XG3QDKLKYI7IV2HUQ347MCARAC

Dependencies

  • [2] XZKO4FNR user: Fix spelling of create-projects role.
  • [3] MNKXBLNC Return 410 Gone (rather than 500) if an output is no longer available
  • [4] AR5EHCUF Add action to restart all failed builds in an eval
  • [5] VHV6GI4L Add a jobset eval action to restart all aborted/cancelled builds
  • [6] YQFIBA4J Restart builds failed due to unsupported system type
  • [7] N45RZUQ6 Reduce I/O in build listings by only fetching required columns
  • [8] 2CZSW5S5 Don't redirect to /login if authentication is required
  • [9] 6S3ZLOZL Return JSON for /eval
  • [10] SSMN5MPT Remove dead code
  • [11] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [12] TNIHMBCR Jobset.pm: Factor out build->eval mapping.
  • [13] QTFVCDIF added hide feature for project/jobset
  • [14] A52HEFHQ * Allow builds to be restarted (if they failed with a transient error,
  • [15] LYVUXIGT Clean up the authorization code a bit
  • [*] U4TD3AIQ Add support for viewing jobset evaluations
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] SZYDW2DG hydra: added some user admin
  • [*] XJRJ4J7M Add user registration

Change contents

  • replacement in src/lib/Hydra/Controller/JobsetEval.pm at line 191
    [4.51][5.379:436](),[5.379][5.379:436]()
    requireProjectOwner($c, $c->stash->{eval}->project);
    [4.51]
    [4.52]
    requireRestartPrivileges($c, $c->stash->{eval}->project);
  • replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 15
    [3.368][5.263:358](),[5.263][5.263:358]()
    forceLogin requireUser requireProjectOwner requireAdmin requirePost isAdmin isProjectOwner
    [3.368]
    [5.9771]
    forceLogin requireUser requireProjectOwner requireRestartPrivileges requireAdmin requirePost isAdmin isProjectOwner
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 174
    [5.1331][5.1029:1030]()
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 182
    [5.794]
    [5.1951]
    }
    sub hasRestartJobsRole {
    my ($c) = @_;
    return $c->user_exists && $c->check_user_roles('restart-jobs');
    }
    sub mayRestartJobs {
    my ($c, $project) = @_;
    return
    $c->user_exists &&
    (isAdmin($c) ||
    hasRestartJobsRole($c) ||
    isProjectOwner($c, $project));
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 198
    [5.1954]
    [5.1031]
    sub requireRestartPrivileges {
    my ($c, $project) = @_;
    requireUser($c);
    accessDenied($c, "Only the project members, administrators, and accounts with restart-jobs privileges can perform this operation.")
    unless mayRestartJobs($c, $project);
    }
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 218
    [5.1034][5.2097:2098](),[5.2097][5.2097:2098]()
  • edit in src/root/user.tt at line 83
    [2.60]
    [20.6750]
    [% INCLUDE roleoption role="restart-jobs" %]