Not able to access session data in before_filter

  • Thread starter Preethi Sivakumar
  • Start date
P

Preethi Sivakumar

Hi,

I've a session data that is generated when a user logs in.
I'm trying to access that session data, in before_filter, in a different
controller for passing parameter to the before_filter function.

before_filter :eek:nly => [:index] do |obj|
user = session[:user]
has_permission_in_any(user.id,component_id,permission_id,user.communities)
end

But i'm not able to do that. What might be the reason?
 
B

Brian Candler

Preethi said:
Hi,

I've a session data that is generated when a user logs in.
I'm trying to access that session data, in before_filter, in a different
controller for passing parameter to the before_filter function.

before_filter :eek:nly => [:index] do |obj|
user = session[:user]
has_permission_in_any(user.id,component_id,permission_id,user.communities)
end

But i'm not able to do that. What might be the reason?

As a guess, because you didn't actually say so, you're asking about the
Rails web application framework.

You'd best ask this question on a Rails mailing list. Here you've found
the list for the Ruby programming language (which Rails just happens to
be written in).
 
P

Preethi Sivakumar

Brian said:
Preethi said:
Hi,

I've a session data that is generated when a user logs in.
I'm trying to access that session data, in before_filter, in a different
controller for passing parameter to the before_filter function.

before_filter :eek:nly => [:index] do |obj|
user = session[:user]
has_permission_in_any(user.id,component_id,permission_id,user.communities)
end

But i'm not able to do that. What might be the reason?

As a guess, because you didn't actually say so, you're asking about the
Rails web application framework.

You'd best ask this question on a Rails mailing list. Here you've found
the list for the Ruby programming language (which Rails just happens to
be written in).


thanks for guiding me to the right path :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top