Hi,

I want to combine an ACL with Zend_Acl with the output of a Zend_View
script. Here is the scenario:

I have a couple of user groups, for example admin and employer. Then I
have some admind and employers A, B and C. The admins and employers
should be able to show a job application. But depending on user group
and the user itself, all these guys should have different access to a
job application view.

- Admins should be able to see all detailed data of the job application
- Employer A is a normal employer with no special user based
  limitations. He should see everything except an internal memo
  field.
- Employer B should see everything that employer A can see, without
  the ranking and a special status field.
- Employer C should see everything that employer A can see, without
  the email communication for this application and a special status
  field.

The question is not how to build the ACL for this scenario. The question
is how to handle this in the view scripts.

First, I thought of a different view script for each user group. While
this might be practical for user group depending limitations, it is not
for user depending limitations. I would end up with lots of redundant
code in these view scripts.

Then I thought of a single view script which handles all these special
cases with some if() constructs. Now I don't have much redundant code,
but the view script is too complicated.

In the end I thought of handling the limitations in some view helpers.
For example I will have a view helper to display the ranking. This view
helper checks the ACL and displays the data or not. While this sounds
practical for the ranking it is not for the special status field. This
is displayed in a table and when displaying this table I need to check
for the status field heading as well as for the status field data. So I
would need a view helper for the heading and for the field. And it
should take care of the <td> and </td> tags as well. This sounds a bit
complicated as well.

In the real project there a much more fields that should be displayed or
not depending on the user rights. So I am looking for a way to handle
this in a more general way.

Has anyone had the same problems so far and found a proper solution yet?

Thanks and best regards,

Ralf

Reply via email to