This topic is locked

After Login, specified views

7/29/2007 14:23:23
PHPRunner General questions
M
mhoerner author

Hello,
I have a user table. Some user have an indicator "department A" = X and some user have an inidicator "department B" = x
After successful login, the users will be redirect to a news_list.php page. In the news table have some news the indicator "department A" = x und some news the indicator "department B" = X.
How can I control, that each user only see their relevant news?
Regards,
Chris

H
horsey_kim 7/30/2007

I would create a view (of the table name where your news is stored) for Department A and a view for Department B. In the sql statement have it only pull the indicator A or B depending on the view (table name) your working with.
Then under Security and under permissions button, Set the groupID field to your indicator from the user table. Now you can add a group based on the indicator fields in your user table. Then just simply go thru your views and give each group permission to view the table names (view) that pertain to their group.
I hope that makes sense? I am doing a similar thing with about 7 different groups pulling off data that only applies to them and also setting permissions on what they can do with it using this process.
Kim <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=20003&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

M
mhoerner author 8/2/2007

Hello Kim,
thanks for replay.
But I want a dynamic solution.
In my user table have some user the indicator A and some the indicator B. The indicators come from a further table, which can be extended at any time.

I would like a solution that check which indicator is in the user table for the current user.
For example: If the indicator is B, so only entries in den news table should be show in the news_list.php, which have also the indicator B.
Any ideas?
Chris

M
mhoerner author 8/2/2007

Ok, I found a solution with the Owner ID