mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
allow any authenticated user to access the schedule preview API endpoint
see: https://github.com/ansible/tower/issues/1939
This commit is contained in:
parent
1564f62c2a
commit
63f089c712
@ -720,6 +720,7 @@ class SchedulePreview(GenericAPIView):
|
||||
model = Schedule
|
||||
view_name = _('Schedule Recurrence Rule Preview')
|
||||
serializer_class = SchedulePreviewSerializer
|
||||
permission_classes = (IsAuthenticated,)
|
||||
|
||||
def post(self, request):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
|
||||
@ -87,6 +87,12 @@ def test_invalid_rrules(post, admin_user, project, inventory, rrule, error):
|
||||
assert error in resp.content
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_normal_users_can_preview_schedules(post, alice):
|
||||
url = reverse('api:schedule_rrule')
|
||||
post(url, {'rrule': get_rrule()}, alice, expect=200)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_utc_preview(post, admin_user):
|
||||
url = reverse('api:schedule_rrule')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user