Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Hiding Quotas depending on the user

Hey there,

I am able to hide certain Quotas for all users, but I would like to hide certain Quotas depending on the name used when logged into the backend.
Is this possible?

Here is the Code how I changed the ssi_admin_javascript9_12_1 file:

$('td.quota_name_cell').each(function () {
  if (($(this).text().includes('XYZ')) && ($("#sign_in_username").text().includes('user')){
        $(this).parent().css("display","none");
  }
})


The Code workes compleatly fine when i dont add this part "&& ($("#sign_in_username").text().includes('user')" in the if-condition.

What am I doing wrong?

Best regards!
asked Nov 30, 2022 by Sarah
The problem is that after the user has signed in, the "#sign_in_username" element no longer exists on the page.  I've taken a look around the other page contents and cookies, but haven't been able to identify anything on the survey summary page that could be used to differentiate users.  This might not be possible without much more advanced customizations being made to the admin module.
Thank you so much for your Input.

I tried a bit more and as I am sending a direct link to my users (so they dont need to log in explicitly), the following code worked for me:

$('td.quota_name_cell').each(function () {
  if (($(this).text().includes('XYZ')) && (window.location.href.includes('user'))){
        $(this).parent().css("display","none");
  }
})
I see.  Nice work there.

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.
...