Actually I have done this using role_requirement. First you need to make sure what your storing in your session doing the login process.
On sucessfully logging in you have to have something like: session[:user] = @user Also you need to understand if your storing the username, the user_id or the whole user object. Also you should know where your session store is. I've found its useful to include 'pp' and to print things out. Easier to see. On Apr 7, 12:27 pm, "[email protected]" <[email protected]> wrote: > Does anyone know how to check the current user field (I have an admin > field to have a simple role base permission level) in the > "config.actions.add :delete" line? > > The generated loginsystem store the session['user'], and I was able to > use that object data in the view but not the controller where I use > config.actions.add to add the delete as an option for admin only. > > I tried it with @session['user'].admin, session['user'], and other > variations and it wasn't able to even pull that session up. > > Can anyone please help? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
