1640 views

Description

If a notification email is sent using Survey trigger conditions, accessing the Take Survey link as a Guest user throws the error "You are not authorized to take this survey" even though the survey is public.

Steps to Reproduce

 

  1. Log in as a survey admin/system admin.

  2. Navigate to Survey > Survey Designer and create a new survey.

  3. In the Design tab, add a couple of questions to it.

  4. In the Availability tab, make sure Anyone is selected.

  5. Using the context drop-down menu, select Save and Publish.

  6. Navigate to Survey > Administration > Trigger Conditions to create trigger condition to the survey.

  7. Make sure email is triggered and a notification is sent to the user.

  8. Try to access the Take Survey URL from email as a Guest user.

    Note that accessing the Take Survey link results in a "You are not authorized to take this survey" error though the survey is a public survey.

 

 

 

Workaround

Remove the following lines of code from the assessment_take2 UI Page:

<g:evaluate var="jvar_redirect_to_login">
var isUserLoggedIn = gs.isLoggedIn();
var redirectLogin = "false";
if('${jvar_is_public_survey}' == 'false' ${AND} !isUserLoggedIn)
redirectLogin = "true";
redirectLogin;
</g:evaluate>
<j:if test="${jvar_redirect_to_login == 'true'}">
<script>document.location.href = "assessment_redirect.do?sysparm_survey_url=${sysparm_this_url}";</script>
</j:if>

Then add the following piece of code after the <g:evaluate jelly="true" var="jvar_assessable_sysid">  tag ends:

<g:evaluate var="jvar_redirect_to_login">
var isUserLoggedIn = gs.isLoggedIn();
var redirectLogin = "false";
if((('${jvar_is_public_survey}' == 'false') || ('${jvar_assessable_sysid}' == 'not_authorized')) ${AND} !isUserLoggedIn)
redirectLogin = "true";
redirectLogin;
</g:evaluate>
<j:if test="${jvar_redirect_to_login == 'true'}">
<script>document.location.href = "assessment_redirect.do?sysparm_survey_url=${sysparm_this_url}";</script>
</j:if>

 


Related Problem: PRB682066

Seen In

Fuji Patch 11
Fuji Patch 12 Hot Fix 1
Geneva Patch 3 Hot Fix 2
Geneva Patch 4
Geneva Patch 4 Hot Fix 6
Geneva Patch 5
Geneva Patch 6 Hot Fix 2
Geneva Patch 7
Helsinki Patch 1

Fixed In

Geneva Patch 9
Helsinki Patch 5
Istanbul

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-06-22 07:50:43
Published:2016-09-01