Merge lp:~arthur-she/lava-scheduler/fix-for-bug-1172724 into lp:lava-scheduler

Proposed by Arthur She
Status: Approved
Approved by: Senthil Kumaran S
Approved revision: 250
Proposed branch: lp:~arthur-she/lava-scheduler/fix-for-bug-1172724
Merge into: lp:lava-scheduler
Diff against target: 15 lines (+4/-1)
1 file modified
lava_scheduler_app/models.py (+4/-1)
To merge this branch: bzr merge lp:~arthur-she/lava-scheduler/fix-for-bug-1172724
Reviewer Review Type Date Requested Status
Senthil Kumaran S Approve
Review via email: mp+171041@code.launchpad.net

This proposal supersedes a proposal from 2013-06-24.

Description of the change

Let the logged-in user who is the member of builds / baselines group has the permission to cancel/re-submit/annotate the jobs which were submitted by 'ciadmin'.

To post a comment you must log in.
Revision history for this message
Arthur She (arthur-she) wrote : Posted in a previous version of this proposal

Let the logged-in user who is the member of builds / baselines group can manipulate (cancel / re-submit / annotate) the jobs which were submitted by 'ciadmin'

Revision history for this message
Senthil Kumaran S (stylesen) wrote : Posted in a previous version of this proposal

Your fixes should be 80 column aligned. Please make sure the line you are editing is 80 column aligned and re-submit the patch.

review: Needs Fixing
Revision history for this message
Senthil Kumaran S (stylesen) wrote :

+1 for this change.

review: Approve
Revision history for this message
Antonio Terceiro (terceiro) wrote :

I realize this has already been merged, but I need to comment. :-)

> === modified file 'lava_scheduler_app/models.py'
> --- lava_scheduler_app/models.py 2013-02-10 21:26:06 +0000
> +++ lava_scheduler_app/models.py 2013-06-24 09:24:26 +0000
> @@ -477,7 +477,10 @@
> """ used to check for things like if the user can cancel or annotate
> a job failure
> """
> - return user.is_superuser or user == self.submitter
> + ci_admin_groups = ['builds', 'baselines']
> + return (user.is_superuser or user == self.submitter or
> + ('ciadmin' == self.submitter.username and
> + user.groups.filter(name__in=ci_admin_groups).exists()))

Maybe we could instead add an attribute to groups that says whether a
group can manage jobs and then check for that being True here, instead
of hardcoding group names in the code like this.

--
Antonio Terceiro
Software Engineer - Linaro
http://www.linaro.org

Unmerged revisions

250. By Arthur She

fix bug #1172724.
Make the code 80 columns aligned.

modified:
  lava_scheduler_app/models.py

249. By Arthur She

fix bug #1172724.
Make the code 80 columns aligned

modified:
  lava_scheduler_app/models.py

248. By Arthur She

fix for bux #1172724

modified:
  lava_scheduler_app/models.py

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_scheduler_app/models.py'
2--- lava_scheduler_app/models.py 2013-02-10 21:26:06 +0000
3+++ lava_scheduler_app/models.py 2013-06-24 09:24:26 +0000
4@@ -477,7 +477,10 @@
5 """ used to check for things like if the user can cancel or annotate
6 a job failure
7 """
8- return user.is_superuser or user == self.submitter
9+ ci_admin_groups = ['builds', 'baselines']
10+ return (user.is_superuser or user == self.submitter or
11+ ('ciadmin' == self.submitter.username and
12+ user.groups.filter(name__in=ci_admin_groups).exists()))
13
14 def can_annotate(self, user):
15 """

Subscribers

People subscribed via source and target branches