Add bump-to-front role

[?]
Nov 5, 2019, 6:24 PM
6DMDTQ7MVNBUFZLF6F3N2TCJH3VALH3T56DOOSOR53LXYSLBNHFQC

Dependencies

  • [2] WE5Q2NVI Allow build to be bumped to the front of the queue via the web interface
  • [3] JO75HQLO Add a restart-jobs role
  • [4] LZVO64YG Merge in the first bits of the API work
  • [5] 6S3ZLOZL Return JSON for /eval
  • [6] MZ63OVKP Allow bumping an entire evaluation to the front of the queue
  • [7] T273UOB7 Support obtaining the contents of an evaluation as a channel
  • [8] Z6MDQIGO * A quick (non-Web 2.0) interface to manually add builds to a release.
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] U4TD3AIQ Add support for viewing jobset evaluations
  • [*] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [*] LYVUXIGT Clean up the authorization code a bit
  • [*] SZYDW2DG hydra: added some user admin
  • [*] XJRJ4J7M Add user registration

Change contents

  • replacement in src/lib/Hydra/Controller/Build.pm at line 543
    [2.2489][2.2489:2559]()
    requireProjectOwner($c, $build->project); # FIXME: require admin?
    [2.2489]
    [2.2559]
    requireBumpPrivileges($c, $build->project);
  • replacement in src/lib/Hydra/Controller/JobsetEval.pm at line 213
    [4.79][4.79:160]()
    requireProjectOwner($c, $c->stash->{eval}->project); # FIXME: require admin?
    [4.79]
    [4.160]
    requireBumpPrivileges($c, $c->stash->{eval}->project); # FIXME: require admin?
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 16
    [3.183]
    [12.9771]
    requireBumpPrivileges
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 183
    [13.794]
    [3.184]
    }
    sub hasBumpJobsRole {
    my ($c) = @_;
    return $c->user_exists && $c->check_user_roles('bump-to-front');
    }
    sub mayBumpJobs {
    my ($c, $project) = @_;
    return
    $c->user_exists &&
    (isAdmin($c) ||
    hasBumpJobsRole($c) ||
    isProjectOwner($c, $project));
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 199
    [3.187]
    [3.187]
    sub requireBumpPrivileges {
    my ($c, $project) = @_;
    requireUser($c);
    accessDenied($c, "Only the project members, administrators, and accounts with bump-to-front privileges can perform this operation.")
    unless mayBumpJobs($c, $project);
    }
  • edit in src/root/user.tt at line 84
    [3.809]
    [15.6750]
    [% INCLUDE roleoption role="bump-to-front" %]