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 end
def filter_album def filter_album
@tags = @module_app.tags @tags = @module_app.tags
categories = @module_app.categories.enabled @categories = @module_app.categories.enabled
@filter_fields = filter_fields(categories, @tags) @filter_fields = filter_fields(@categories, @tags)
@filter_fields.delete(:status) @filter_fields.delete(:status)
albums = Album.all.asc(:order).with_categories(filters("category")).with_tags(filters("tag")) albums = Album.all.asc(:order).with_categories(filters("category")).with_tags(filters("tag"))
@fiter_albums = search_data(albums,[:name]) @fiter_albums = search_data(albums,[:name])
@ -356,7 +356,7 @@ class Admin::GalleriesController < OrbitAdminController
def new def new
@album = Album.new @album = Album.new
@tags = @module_app.tags @tags = @module_app.tags
@categories = @module_app.categories @categories = @module_app.categories.enabled.authorized(current_user)
end end
def create def create
@ -375,7 +375,7 @@ class Admin::GalleriesController < OrbitAdminController
@album = Album.find(params[:id]) @album = Album.find(params[:id])
if can_edit_or_delete?(@album) if can_edit_or_delete?(@album)
@tags = @module_app.tags @tags = @module_app.tags
@categories = @module_app.categories @categories = @module_app.categories.enabled.authorized(current_user)
else else
render_401 render_401
end end