| hi sir, I have a question regarding on how to implement a user access rights using netzke? that is how can restrict a user from inserting , updating or deleting a record in a model. example. how can prevent a user to insert on the model if it failed if current_user.can_create? # proceed to add record else # display a message user can add new records end Second , question is how can i make the display of a password field hidden upon entry on the Gridpanel. There is not much documentation on this matter sir. thank you. Charles Gan --- On Sun, 8/5/12, nomadcoder <nmc...@gmail.com> wrote: |
|
| Sir, Found a solution on my own question. its thru your prohibit method on netzke gridpanel eg. <%= netzke :areas, :class_name => "Netzke::Basepack::GridPanel", :model => "Area", :height => 400, :columns => [:areacode, :description], :prohibit_create => !current_user.verify_rights("AREA","I"), :prohibit_update => !current_user.verify_rights("AREA","E"), :prohibit_delete => !current_user.verify_rights("AREA","D") %> Although the "Add in Form" button in bbar is still enabled and working. I can still create a new record in the model. How can you enabled/disable this. although the prohibit_update already control the enabled/disable of both the edit button and the Edit in form button. Charles Gan --- On Sat, 8/11/12, Charles Gan <chat...@yahoo.com.ph> wrote: |