title: Permission management by tab removal using SQL
body: <p>I need an idea. I have an app, a winform having multiple tabs in it. There are a bunch of people using it, but none of them needs to use all the tabs, just a couple of them. I've reached a point where it's hard to handle from the source code, so I need a solution to easily manage the permissions. The best would be to use an SQL table for this as I also have to provide for another guy the possibility to modify the rights. I think it would be fine to simply remove the tabs by creating an sql table like this, and at the program startup simply query something like this:</p>
  
  <pre><code>select tabid from table where loggedinuser = 0
  </code></pre>
  
  <p>and then just loop through the result and remove all of them</p>
  
  <pre><code>foreach(tabid in tabids)
  {
      tabControl1.TabPages.RemoveByKey(tabid);
  }
  </code></pre>
  
  <p>table:</p>
  
  <pre><code>+----------+----------+-------+-------+-------+
  | tabid    | name     | user1 | user2 | user3 |
  +----------+----------+-------+-------+-------+
  | tabPage1 | project1 | 0     | 1     | 0     |
  +----------+----------+-------+-------+-------+
  | tabPage2 | project2 | 1     | 0     | 1     |
  +----------+----------+-------+-------+-------+
  | tabPage3 | project3 | 1     | 0     | 0     |
  +----------+----------+-------+-------+-------+
  </code></pre>
  
  <p>However I somehow feel that this is not an elegant solution, especially because you have create a new column each time a new guy has to be added. Do you have any idea how to solve it?</p>