The issue is that I want to pull specific records from SQL table and display it according to user privileges (which is a case of 5 combined true or false). Is there a way to avoid writing 32 separate checks and also 32 separate SQL select statements for all the cases of true of false for the combined 5 privileges?
ex:
bool priv1 true|false;
bool priv2 true|false;
bool priv3 true|false;
bool priv4 true|false;
bool priv5 true|false;
if (priv1 && !priv2 && !priv3 && !priv4 && !priv5)
{
string sql = "SELECT * FROM table WHERE priv='1'";
}
and so on....
Edit: I want to mention that one user can have multi privileges and this is the main issue and why i said 32 cases.