]> source.dussan.org Git - redmine.git/commitdiff
Use Group.visible instead of manual visibility check in GroupsController (#38144).
authorGo MAEDA <maeda@farend.jp>
Wed, 4 Jan 2023 01:05:20 +0000 (01:05 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 4 Jan 2023 01:05:20 +0000 (01:05 +0000)
Patch by Holger Just.

git-svn-id: https://svn.redmine.org/redmine/trunk@22023 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/groups_controller.rb

index c52b3300852058cd6ae41d21f5c3f6b20b87397f..85192a9d70ae49992fdd6587064357011ea7a879 100644 (file)
@@ -50,8 +50,6 @@ class GroupsController < ApplicationController
   end
 
   def show
-    return render_404 unless @group.visible?
-
     respond_to do |format|
       format.html do
         render :layout => 'base'
@@ -149,7 +147,7 @@ class GroupsController < ApplicationController
   private
 
   def find_group
-    @group = Group.find(params[:id])
+    @group = Group.visible.find(params[:id])
   rescue ActiveRecord::RecordNotFound
     render_404
   end