Is it safe to have a fallback no 'toggle condition' group in a query to hide data?

Hello everyone!

In the past few days I have created a query which had the job to restrict giving out certain content when the conditions are not met. The query works as intended.
At the end of the conditions-section of the query I have a section which comes in as a 'fail safe'.
When every other condition group fails the non-condition group shall be run.
Is THIS safe enough to not give out every chosen field from the table or should i rather choose a different way?

Did you verify if that "fail safe" actually works? Or is it just an hypothesis? I'm not sure if that "fail safe" makes sense from a logic's point-of-view :thinking:

Even if you're right, it's very difficult to understand the context from your description/screenshot, so it's unlikely someone will be able to confirm your theory. You have the query results, table structure and the name of the conditions you're talking about. We don't have any of that, it makes thinking 10x more difficult :frowning:

And this is the third-time I catch you doing unusual stuff :slight_smile:

1 Like

I am just an unusual guy, what can I say :laughing:. (I really need to elaborate more on my end when posting questions on here, sorry).

The fail safe indeed works.
What I am doing is basically the following:

Broken down to an abstract level without context:

  1. First I want to check if a condition is met. When it is met, the query should explicitly search for certain rows. (Obviously there are several different conditions above the last 'fallback group', but this is only my doing of things. It could also just be any other condition you come up with).
  2. If no condition is ever met, no query data should be given out -> Thats why it searches for "none" in the last AND Group. None is not existent at all in any table. That is why it cannot give out any data (without this last 'fallback group" the query would just give out every row of the table I have chosen in the 'Columns'-tab of the query builder as stated in this topic: How to ensure Database Query does not return all records if condition is not met?). With this I wanted to prevent creating an own condition step in the server connect editor itself as stated here: How to ensure Database Query does not return all records if condition is not met? - #11 by Teodor, this would've been too much of an eye sore for me creating an own query for every condition I want to be met.

My problem: I basically just want to know if this type of way is safe. Only based on this picture. Is there any thinkable way (IN THIS QUERY) a user still could get access to the rest of the rows or should I rather go the way Teodor mentioned in his post linked above?

Context (if needed):

I have a dropdown menu which is being populated if certain conditions (boolean true/false from a table in the database) are met by the user. If he doesn't match those conditions, I want to just make sure with this last group in the query that the user won't get access to certain options he should not have access to. Hence why it is always being run, there is no condition for it.