mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 19:21:06 -03:30
make CustomInvetoryScript a resource.
This commit is contained in:
@@ -1264,7 +1264,7 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions):
|
||||
return True
|
||||
|
||||
|
||||
class CustomInventoryScript(CommonModelNameNotUnique):
|
||||
class CustomInventoryScript(CommonModelNameNotUnique, ResourceMixin):
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
@@ -1285,6 +1285,27 @@ class CustomInventoryScript(CommonModelNameNotUnique):
|
||||
on_delete=models.SET_NULL,
|
||||
)
|
||||
|
||||
admin_role = ImplicitRoleField(
|
||||
role_name='CustomInventory Administrator',
|
||||
role_description='May manage this inventory',
|
||||
parent_role='organization.admin_role',
|
||||
permissions = {'all': True}
|
||||
)
|
||||
|
||||
member_role = ImplicitRoleField(
|
||||
role_name='CustomInventory Member',
|
||||
role_description='May view but not modify this inventory',
|
||||
parent_role='organization.member_role',
|
||||
permissions = {'read': True}
|
||||
)
|
||||
|
||||
auditor_role = ImplicitRoleField(
|
||||
role_name='CustomInventory Auditor',
|
||||
role_description='May view but not modify this inventory',
|
||||
parent_role='organization.auditor_role',
|
||||
permissions = {'read': True}
|
||||
)
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('api:inventory_script_detail', args=(self.pk,))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user