Similar question - what is the best way to hide certain fields on
indexSuccess.php and layout.php? I have members who belong to
different sfGuardGroups and based on that I either show / hide certain
data elements and text info.
I created logic in templates that checks $sf_user->isAuthenticated(),
$sf_user->hasGroup('Admin'), etc and sets custom $view_mode variable.
Then in the body I check $view_mode and display/hide stuff. I had to
implement this in multiple files and this much biz logic really
doesn't belong in view layer.
I can change the querying logic in my *Table.class.php so I don't
return certain data elements if user shouldn't see them but how do I
handle <th>column_name</th> parts and other pure text?
Thank you
Dmitry
On Dec 21, 7:49 am, Stan McFarland <[email protected]> wrote:
> Thanks to both of you. I have Gabor's method working but will consider
> yours also. Thanks again.
>
> -stan
>
> On Tue, Dec 21, 2010 at 9:39 AM, Yitzchak Schaffer <
>
> [email protected]> wrote:
> > On 2010-12-20 10:27, Stan McFarland wrote:
>
> >> I guess the subject says it all. :) Looking for suggestions as to
> >> how best to hide specific form fields (not in the backend generator,
> >> but the frontend) based on user credentials. Thanks!
>
> > I've created subclasses of the form classes for this purpose; for example,
> > User being the class generated by symfony, and UserFront the subclass which
> > strips away the undesired fields. Comparing this to Gábor's response, mine
> > moves the field-filtering logic from the form class to the action. Not sure
> > if either one is preferable from an architectural perspective... ?
>
> > --
> > Yitzchak Schaffer
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to
> > security at symfony-project.com
>
> > You received this message because you are subscribed to the Google
> > Groups "symfony users" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<symfony-users%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-users?hl=en
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en