veildemo as the user vdemo_user.
You will be able to see all of the demo views, both the secured views and the helpers. But you will not initially be able to see any records: each view will appear to contain no data. To gain some privileges you must identify yourself using the connect_person() function.
There are 6 persons in the demo. You may connect as any of them and see different subsets of data. The persons are
Here is a sample session, showing the different access enjoyed by different users.
veildemo=> select connect_person(4);
connect_person
----------------
t
(1 row)
veildemo=> select * from persons;
person_id | person_name
-----------+-------------------
4 | Will (the worker)
(1 row)
veildemo=> select * from person_details;
person_id | detail_type_id | value
-----------+----------------+--------------
4 | 1003 | 20050105
4 | 1002 | Employee
4 | 1004 | 30,000
4 | 1005 | 19660102
4 | 1006 | 123456789
4 | 1007 | Subservience
(6 rows)
veildemo=> select * from project_details;
project_id | detail_type_id | value
------------+----------------+----------
102 | 1001 | 20050101
102 | 1002 | Ongoing
(2 rows)
veildemo=> select connect_person(2);
connect_person
----------------
t
(1 row)
veildemo=> select * from person_details;
person_id | detail_type_id | value
-----------+----------------+-------------------
1 | 1003 | 20050102
2 | 1003 | 20050103
3 | 1003 | 20050104
4 | 1003 | 20050105
5 | 1003 | 20050106
6 | 1003 | 20050107
1 | 1002 | Employee
2 | 1002 | Employee
3 | 1002 | Employee
4 | 1002 | Employee
5 | 1002 | Employee
6 | 1002 | Terminated
2 | 1004 | 50,000
1 | 1005 | 19610102
2 | 1005 | 19600102
3 | 1005 | 19650102
4 | 1005 | 19660102
5 | 1005 | 19670102
2 | 1006 | 123456789
1 | 1007 | Oracle, C, SQL
2 | 1007 | Soft peoply-stuff
3 | 1007 | None at all
4 | 1007 | Subservience
5 | 1007 | Subservience
(24 rows)
veildemo=> select * from project_details;
project_id | detail_type_id | value
------------+----------------+----------
102 | 1001 | 20050101
102 | 1002 | Ongoing
102 | 1008 | $100,000
(3 rows)
veildemo=>
Next: The Demo Code
1.5.4