Skip to content

Commit a27cb67

Browse files
committed
add a per-project rule to change CI checks
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent 30bd5aa commit a27cb67

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎patchwork/api/check.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ def is_editable(self, user, patch):
119119
patch._edited_by = user
120120
return True
121121

122+
if user.has_perm('patchwork.add_check', patch.project):
123+
patch._edited_by = user
124+
return True
125+
122126
# Being maintainer doesn't grant rights to create checks.
123127
return False
124128

‎patchwork/models.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ def __str__(self):
122122
class Meta:
123123
unique_together = (('listid', 'subject_match'),)
124124
ordering = ['linkname']
125+
permissions = [
126+
# Per-project permission to add checks
127+
("add_check", "Can add checks"),
128+
]
125129

126130

127131
class DelegationRule(models.Model):

0 commit comments

Comments
 (0)