From 739c7e4f41a4d4a24504a073b73a15634bb0509a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sun, 4 Aug 2024 02:58:04 +0800 Subject: [PATCH] Fix authorized. --- app/controllers/admin/galleries_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index 8a108f3..9e1f0c4 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -288,8 +288,8 @@ class Admin::GalleriesController < OrbitAdminController end def filter_album @tags = @module_app.tags - categories = @module_app.categories.enabled - @filter_fields = filter_fields(categories, @tags) + @categories = @module_app.categories.enabled + @filter_fields = filter_fields(@categories, @tags) @filter_fields.delete(:status) albums = Album.all.asc(:order).with_categories(filters("category")).with_tags(filters("tag")) @fiter_albums = search_data(albums,[:name]) @@ -356,7 +356,7 @@ class Admin::GalleriesController < OrbitAdminController def new @album = Album.new @tags = @module_app.tags - @categories = @module_app.categories + @categories = @module_app.categories.enabled.authorized(current_user) end def create @@ -375,7 +375,7 @@ class Admin::GalleriesController < OrbitAdminController @album = Album.find(params[:id]) if can_edit_or_delete?(@album) @tags = @module_app.tags - @categories = @module_app.categories + @categories = @module_app.categories.enabled.authorized(current_user) else render_401 end