mirror of
https://github.com/ansible/awx.git
synced 2026-11-22 00:06:10 -03:30
allow org auditors to see notifications
This commit is contained in:
+4
-1
@@ -1420,7 +1420,10 @@ class NotificationAccess(BaseAccess):
|
||||
qs = self.model.objects.all()
|
||||
if self.user.is_superuser or self.user.is_system_auditor:
|
||||
return qs
|
||||
return self.model.objects.filter(notification_template__organization__in=Organization.accessible_objects(self.user, 'admin_role'))
|
||||
return self.model.objects.filter(
|
||||
Q(notification_template__organization__in=self.user.admin_of_organizations) |
|
||||
Q(notification_template__organization__in=self.user.auditor_of_organizations)
|
||||
).distinct()
|
||||
|
||||
def can_read(self, obj):
|
||||
return self.user.can_access(NotificationTemplate, 'read', obj.notification_template)
|
||||
|
||||
Reference in New Issue
Block a user