fishtest icon indicating copy to clipboard operation
fishtest copied to clipboard

Buttons being displayed even without the required permissions

Open dav1312 opened this issue 3 years ago • 4 comments

A user who is not logged in or that it doesn't have the required permissions to perform a certaint action shouldn't even be able to see (in my opinion) certain action buttons such as "Stop", "Approve", "Reschedule", "Modify", etc.

This would apply to some inputs too like priority or throughput.

Or at least instead of hiding them, adding the disabled attribute to them would be nice.

dav1312 avatar Jan 07 '22 23:01 dav1312

In principle you are right but in my experience making such a thing robust requires some care. The typical case to watch out for is this: the user goes to the test page, then goes to the login page, logs in and uses the back button to go back to the test page. Now the buttons have to be adjusted. But the browser will not reload the page by itself.

So we need some JavaScript to query the login status of the user (I am not sure how the login works, cookie?).

vdbergh avatar Jan 08 '22 06:01 vdbergh

Yes logging in sets a cookie. So this is a pure JavaScript issue.

vdbergh avatar Jan 08 '22 07:01 vdbergh

Maybe related, I no longer see if my test has been approved or not. Is this intentional?

joergoster avatar Jan 15 '22 17:01 joergoster

This #1233 dropped the "question mark" and "thumb up" icons, tests are divided in proper sections both in home page and user page

image

image

ppigazzini avatar Jan 15 '22 19:01 ppigazzini