hi suppos I have this table’s fields : Employees
id , firstname , lastname , birthdate
and I want to make privacy on some fields so I created this table containing these fields
tableName, ColumnName , PrivacyType [Visible/Notvisible]
and when Selecting a row from the first table I don’t want to get the fields that have
privacy type = NotVisible
any idea
Generally, if you need some columns/rows hidden from a (set of) users, you’d implement a view for them. You’d then deny SELECT on the base table. The view definition would only reference those columns that you want to make accessible to the group of users you grant SELECT on the view to.
Once you have access going via views, as I say, you can implement more complex requirements, such as row level security.
(You can do something ugly in your views, if you’re set on having the privacy settings change dynamically, but I wouldn’t recommend it):
Result: