mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Add can_start to notification template access
This commit is contained in:
@@ -3677,6 +3677,7 @@ class NotificationTemplateTest(GenericAPIView):
|
|||||||
model = NotificationTemplate
|
model = NotificationTemplate
|
||||||
serializer_class = EmptySerializer
|
serializer_class = EmptySerializer
|
||||||
new_in_300 = True
|
new_in_300 = True
|
||||||
|
is_job_start = True
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
|
|||||||
@@ -1641,6 +1641,12 @@ class NotificationTemplateAccess(BaseAccess):
|
|||||||
def can_delete(self, obj):
|
def can_delete(self, obj):
|
||||||
return self.can_change(obj, None)
|
return self.can_change(obj, None)
|
||||||
|
|
||||||
|
@check_superuser
|
||||||
|
def can_start(self, obj):
|
||||||
|
if obj.organization is None:
|
||||||
|
return False
|
||||||
|
return self.user in obj.organization.admin_role
|
||||||
|
|
||||||
class NotificationAccess(BaseAccess):
|
class NotificationAccess(BaseAccess):
|
||||||
'''
|
'''
|
||||||
I can see/use a notification if I have permission to
|
I can see/use a notification if I have permission to
|
||||||
|
|||||||
Reference in New Issue
Block a user