Fix authorized.

This commit is contained in:
邱博亞 2024-08-04 02:58:04 +08:00
parent e51824a345
commit 739c7e4f41
1 changed files with 4 additions and 4 deletions

View File

@ -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