Fix before_filter order for object_auth

This commit is contained in:
Christophe Vilayphiou committed 2012-03-20 14:17:28 +08:00
1 parent 7cc075e124
commit e953344965
2 files changed
+14 -4

No files matched your search

@@ -1,8 +1,7 @@
class Admin::ObjectAuthsController < ApplicationController
include OrbitCoreLib::PermissionUnility
layout "admin"
before_filter :authenticate_user!
before_filter :check_if_user_can_do_object_auth
before_filter :force_order
# before_filter :is_admin? ,:only => :index
@@ -84,6 +83,12 @@ class Admin::ObjectAuthsController < ApplicationController
end
private
def force_order
authenticate_user!
check_if_user_can_do_object_auth
end
def check_if_user_can_do_object_auth
unless check_permission(:manager)
render :nothing => true, :status => 403