You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
619 B

12 years ago
class UsersController < ApplicationController
before_filter :authenticate_user!
11 years ago
before_filter :set_user_current
after_filter :unset_user_current
12 years ago
layout :scoped_layout
rescue_from CanCan::AccessDenied, ActiveScaffold::ActionNotAllowed do |exception|
flash.now[:error] = exception.message
render_access_denied
end
protected
11 years ago
def set_user_current
12 years ago
User.current = current_user
11 years ago
end
11 years ago
def unset_user_current
User.current = nil
12 years ago
end
def ensure_nested_under_domain
unless nested? && nested_parent_record.is_a?(Domain)
raise CanCan::AccessDenied, "not found"
end
end
end