Sunday 23 May 2010 3:04:51 pm
Hello Everyone. I have intranet type of solution that I am working on, and i was wondering if anybody has some advice to offer abour this "problem": I have a 'news' section on the frontpage, where all users can add news. When they add a 'news' they are supposed to be able to select which users the 'news' can be available to.
So they add a new 'news' and select from 2 drop down lists:
- Department a / b / c / all - Section x / y / z
So when a user from department b logges in, he ca see the news that have selected department b, and all. Section is depending on department, but the section value will be the same for all deparments, so this simplify things a little bit. The matching will not be that complicated.
What is the best way to achieve this? One solution of course is llimiting the foreach, but that is a heavy way to do it (?)
{def $news=fetch ('content', 'list', hash('parent_node_id', 173 etc...}
{foreach $news as $n}
{if the 'department' matched the users 'department' or 'all' )}
{if the 'section' has been selected and matches the users 'section'}
{...}
{/if}
{/if}
{/foreach}
Another solution is to use the ezpublish's user limitationn.. Then I would have to create one usergroup and section for each 'department' etc etc... Then i would also have to edit the register view, so that the users are put in the usergroup that matches the department they have selected ect... Suggestions? :)
|