Aladin
December 22, 2009, 11:42am
1
hi
my app uses before_filter for authorization in ApplicationController
which filter ‘create’, ‘update’ and so on in every controller. But
let’s say i want to exclude ‘create’ in one particular controller how
would i do this best.
I’m missing something like :
class ApplicationController
before_filter check_permission , :exclude =>
[MailerController::create]
…
–
You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” 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/rubyonrails-talk?hl=en .
Aladin
December 22, 2009, 12:19pm
2
On Tue, Dec 22, 2009 at 1:47 AM, Aladin [email protected] wrote:
[MailerController::create]
…
Hi, you can do the following:
before_filter :check_permission, :except => :create
Good luck,
-Conrad
–
You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” 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/rubyonrails-talk?hl=en .
Aladin
December 22, 2009, 12:25pm
3
This would exclude all create methods in all controllers which is
exactly the the opposite i need.
is using skip_before_filter the rails way to exclude before_filter for
a certain controller?
On 22 Dez., 12:17, Conrad T. [email protected] wrote:
before_filter check_permission , :exclude =>
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en .
–
You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” 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/rubyonrails-talk?hl=en .
Aladin
December 22, 2009, 1:16pm
4
2009/12/22 Aladin [email protected] :
This would exclude all create methods in all controllers which is
exactly the the opposite i need.
is using skip_before_filter the rails way to exclude before_filter for
a certain controller?
You can use :only and :except with skip_before_filter, so put the skip
in the specific controller, specifying which actions to skip in that
controller.
Colin
I’m missing something like :
Good luck,
To unsubscribe from this group, send email to
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en .
–
You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” 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/rubyonrails-talk?hl=en .
Aladin
December 22, 2009, 12:27pm
5
On 22 Dec 2009, at 12:17, Conrad T. wrote:
Hi, you can do the following:
before_filter :check_permission, :except => :create
Or use skip_before_filter in that controller, as you can clearly find
in the API documentation:
http://api.rubyonrails.org/classes/ActionController/Filters/ClassMethods.html
(Filter chain skipping).
Best regards
Peter De Berdt
–
You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” 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/rubyonrails-talk?hl=en .