This commit is contained in:
呱呱呱
2023-08-24 17:03:22 +08:00
parent 31bb2502b8
commit eb449f9937
3 changed files with 12 additions and 5 deletions

View File

@@ -2,11 +2,12 @@ class SitePagesController < ApplicationController
before_action :require_login, except: [:softbot_build, :themes]
before_action :require_profile_completed, only: [:create]
before_action :load_project, except: [:softbot_build, :index, :themes]
before_action :authenticate_user!, except: [:softbot_build, :index, :themes]
before_action :authenticate_user!, except: [:softbot_build, :index, :themes, :show]
before_action :authenticate_member!, only: [:show]
def index
@pages = PageQuery.call(params,current_user)
@pages = paginate(@pages)
pages = PageQuery.call(params,current_user)
@pages = paginate(pages)
end
def show
@@ -66,6 +67,12 @@ class SitePagesController < ApplicationController
end
end
def authenticate_member!
unless @project.member?(current_user) || current_user.admin?
return render_forbidden('你不是成员,没有权限操作')
end
end
def theme_params
params[:language_frame] || "hugo"
end