mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Add can_start to notification template access
This commit is contained in:
parent
9fe408c6f7
commit
f68baadc39
@ -3677,6 +3677,7 @@ class NotificationTemplateTest(GenericAPIView):
|
||||
model = NotificationTemplate
|
||||
serializer_class = EmptySerializer
|
||||
new_in_300 = True
|
||||
is_job_start = True
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
obj = self.get_object()
|
||||
|
||||
@ -1641,6 +1641,12 @@ class NotificationTemplateAccess(BaseAccess):
|
||||
def can_delete(self, obj):
|
||||
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):
|
||||
'''
|
||||
I can see/use a notification if I have permission to
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user