I had this problem before, you will have to take the user object and
pass it to the form class and check the credentials and then unset the
widget there. If there is no user object you will have to unset it.

On Jan 18, 9:25 am, Ahsanul <ahsanu...@gmail.com> wrote:
> Hello all,
>
> I have a Doctrine table called "Comment" which has a field called
> "is_published" and as I have different type of users I don want my
> basic users see my "is_published" widget. But I can not unset this
> widget from a controller where I can check the credentials, on the
> other hand in a form, I do not have access to the currently logged in
> user so I can not check the credentials. I am sure Symfony has a
> solution for this! Please help!
>
> My comment form is as following:
>
> Comment:
>     actAs:
>         Timestampable: ~
>     columns:
>         id: { type: integer, primary: true, autoincrement: true }
>         title: { type: string(255), notnull: true }
>         body: { type: string(1024), notnull: true }
>         is_published: { type: boolean, default: false }
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to