mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
Clean up a few more cases where we checked the license for features.
This commit is contained in:
@@ -789,7 +789,6 @@ class OrganizationAccess(NotificationAttachMixin, BaseAccess):
|
|||||||
return self.user in obj.admin_role
|
return self.user in obj.admin_role
|
||||||
|
|
||||||
def can_delete(self, obj):
|
def can_delete(self, obj):
|
||||||
self.check_license(check_expiration=False)
|
|
||||||
is_change_possible = self.can_change(obj, None)
|
is_change_possible = self.can_change(obj, None)
|
||||||
if not is_change_possible:
|
if not is_change_possible:
|
||||||
return False
|
return False
|
||||||
@@ -1440,9 +1439,6 @@ class JobTemplateAccess(NotificationAttachMixin, BaseAccess):
|
|||||||
# if reference_obj is provided, determine if it can be copied
|
# if reference_obj is provided, determine if it can be copied
|
||||||
reference_obj = data.get('reference_obj', None)
|
reference_obj = data.get('reference_obj', None)
|
||||||
|
|
||||||
if 'survey_enabled' in data and data['survey_enabled']:
|
|
||||||
self.check_license(feature='surveys')
|
|
||||||
|
|
||||||
if self.user.is_superuser:
|
if self.user.is_superuser:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -1514,9 +1510,6 @@ class JobTemplateAccess(NotificationAttachMixin, BaseAccess):
|
|||||||
|
|
||||||
data = dict(data)
|
data = dict(data)
|
||||||
|
|
||||||
if 'survey_enabled' in data and obj.survey_enabled != data['survey_enabled'] and data['survey_enabled']:
|
|
||||||
self.check_license(feature='surveys')
|
|
||||||
|
|
||||||
if self.changes_are_non_sensitive(obj, data):
|
if self.changes_are_non_sensitive(obj, data):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -1951,10 +1944,6 @@ class WorkflowJobTemplateAccess(NotificationAttachMixin, BaseAccess):
|
|||||||
if not data: # So the browseable API will work
|
if not data: # So the browseable API will work
|
||||||
return Organization.accessible_objects(self.user, 'workflow_admin_role').exists()
|
return Organization.accessible_objects(self.user, 'workflow_admin_role').exists()
|
||||||
|
|
||||||
# will check this if surveys are added to WFJT
|
|
||||||
if 'survey_enabled' in data and data['survey_enabled']:
|
|
||||||
self.check_license(feature='surveys')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
self.check_related('organization', Organization, data, role_field='workflow_admin_role', mandatory=True) and
|
self.check_related('organization', Organization, data, role_field='workflow_admin_role', mandatory=True) and
|
||||||
self.check_related('inventory', Inventory, data, role_field='use_role')
|
self.check_related('inventory', Inventory, data, role_field='use_role')
|
||||||
|
|||||||
Reference in New Issue
Block a user