keeleinstituut / tv-tolkevarav

Tõlkevärav (Translation Hub)
1 stars 0 forks source link

Skip request to backend if privilege is missing #795

Open MariusJulius opened 2 weeks ago

MariusJulius commented 2 weeks ago

1 thing we could improve here and in some other places, is to skip the request made to BE, if we already know of FE that the user doesn't have the privilege to do that request. This would also involve disabling some extra buttons in those cases. For example the role filters button in this view, if user doesn't have the privilege to fetch roles.

We already have this logic in some places, but in others we didn't have a concrete understanding of whether a user without a certain privilege should be able to access that resource (For example fetching roles without the correct privilege for use in filters). During the last longer grooming we decided to make sure that privileges are logical and you need to have the corresponding privilege, which means that there are places in FE which can be improved based on this information.

Hopefully we can stick it to maintenance, as this is more of a nice-to-have visual update

Originally posted by @KaarelKa in https://github.com/keeleinstituut/tv-tolkevarav/issues/755#issuecomment-2175594602