cg_import policy stub
This commit is contained in:
parent
fe4982c70c
commit
34a400652e
2 changed files with 16 additions and 2 deletions
|
|
@ -4708,7 +4708,7 @@ class CG_Importer(object):
|
|||
self.prep_brs()
|
||||
self.prep_outputs()
|
||||
|
||||
# TODO: policy hooks
|
||||
self.assert_policy()
|
||||
|
||||
koji.plugin.run_callbacks('preImport', type='cg', metadata=metadata,
|
||||
directory=directory)
|
||||
|
|
@ -4767,6 +4767,17 @@ class CG_Importer(object):
|
|||
self.cgs = cgs
|
||||
|
||||
|
||||
def assert_policy(self):
|
||||
policy_data = {
|
||||
'package': self.buildinfo['name'],
|
||||
'source': self.buildinfo.get('source'),
|
||||
'metadata_only': self.metadata_only,
|
||||
'cg_list' : list(self.cgs),
|
||||
# TODO: provide more data
|
||||
}
|
||||
assert_policy('cg_import', policy_data)
|
||||
|
||||
|
||||
def prep_build(self):
|
||||
metadata = self.metadata
|
||||
buildinfo = get_build(metadata['build'], strict=False)
|
||||
|
|
|
|||
|
|
@ -546,7 +546,10 @@ _default_policies = {
|
|||
'vm' : '''
|
||||
has_perm admin win-admin :: allow
|
||||
all :: deny
|
||||
'''
|
||||
''',
|
||||
'cg_import' :'''
|
||||
all :: allow
|
||||
''',
|
||||
}
|
||||
|
||||
def get_policy(opts, plugins):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue