diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-10-07 14:17:06 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-10-10 16:32:32 +0300 |
commit | 66c32cab1af621caa6ae3cb24b82b344d43512a5 (patch) | |
tree | d0c0e9abaeba59e9f5ae8a7228e774c932c13672 /app | |
parent | b26a3d538178c82d4e7af2076ba999087225666c (diff) | |
download | gitlab-ce-66c32cab1af621caa6ae3cb24b82b344d43512a5.tar.gz |
Remove NamespacesController
The main purpose of this controller was redirect to group or user page
when URL like https://gitlab.com/gitlab-org was used. Now this
functionality is handled by contrainers and take user to correct
controller right from the start
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/namespaces_controller.rb | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/app/controllers/namespaces_controller.rb b/app/controllers/namespaces_controller.rb deleted file mode 100644 index 83eec1bf4a2..00000000000 --- a/app/controllers/namespaces_controller.rb +++ /dev/null @@ -1,25 +0,0 @@ -class NamespacesController < ApplicationController - skip_before_action :authenticate_user! - - def show - namespace = Namespace.find_by(path: params[:id]) - - if namespace - if namespace.is_a?(Group) - group = namespace - else - user = namespace.owner - end - end - - if user - redirect_to user_path(user) - elsif group && can?(current_user, :read_group, group) - redirect_to group_path(group) - elsif current_user.nil? - authenticate_user! - else - render_404 - end - end -end |