[FIX] runbot: fix config access rights

This commit is contained in:
Xavier-Do 2019-05-18 15:13:21 +02:00
parent 98913f6d39
commit 8a7e0b20aa
2 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ class ConfigStep(models.Model):
if not re.match(name_reg, values.get('name')):
raise UserError('Name cannot contain special char or spaces exepts "_" and "-"')
if not self.env.user.has_group('runbot.group_build_config_administrator'):
if (values.get('job_type') == 'python' or ('python_code' in values and values['python_code'])):
if (values.get('job_type') == 'python' or ('python_code' in values and values['python_code'] and values['python_code'] != "# type python code here\n\n\n\n\n\n")):
raise UserError('cannot create or edit config step of type python code')
if (values.get('extra_params')):
reg = r'^[a-zA-Z0-9\-_ "]*$'

View File

@ -51,7 +51,7 @@
<field name="name">All config can be edited by config admin</field>
<field name="groups" eval="[(4, ref('group_build_config_administrator'))]"/>
<field name="model_id" ref="model_runbot_build_config"/>
<field name="domain_force">[('1', '=', '1')]</field>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_read" eval="False"/>