allow staff members to view staged accounts user card/profile
This commit is contained in:
parent
8c48c12498
commit
16b3d26d7b
|
@ -231,7 +231,6 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
render json: MultiJson.dump(obj), status: opts[:status] || 200
|
||||
end
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ class ListController < ApplicationController
|
|||
[:topics_by, :private_messages, :private_messages_sent, :private_messages_unread].each do |action|
|
||||
define_method("#{action}") do
|
||||
list_opts = build_topic_list_options
|
||||
target_user = fetch_user_from_params
|
||||
target_user = fetch_user_from_params(include_inactive: current_user.try(:staff?))
|
||||
guardian.ensure_can_see_private_messages!(target_user.id) unless action == :topics_by
|
||||
list = generate_list_for(action.to_s, target_user, list_opts)
|
||||
url_prefix = "topics" unless action == :topics_by
|
||||
|
|
|
@ -6,7 +6,7 @@ class UserActionsController < ApplicationController
|
|||
|
||||
per_chunk = 60
|
||||
|
||||
user = fetch_user_from_params
|
||||
user = fetch_user_from_params(include_inactive: current_user.try(:staff?))
|
||||
|
||||
opts = { user_id: user.id,
|
||||
user: user,
|
||||
|
|
|
@ -31,7 +31,7 @@ class UsersController < ApplicationController
|
|||
def show
|
||||
raise Discourse::InvalidAccess if SiteSetting.hide_user_profiles_from_public && !current_user
|
||||
|
||||
@user = fetch_user_from_params
|
||||
@user = fetch_user_from_params(include_inactive: current_user.try(:staff?))
|
||||
user_serializer = UserSerializer.new(@user, scope: guardian, root: 'user')
|
||||
if params[:stats].to_s == "false"
|
||||
user_serializer.omit_stats = true
|
||||
|
@ -621,7 +621,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def staff_info
|
||||
@user = fetch_user_from_params
|
||||
@user = fetch_user_from_params(include_inactive: true)
|
||||
guardian.ensure_can_see_staff_info!(@user)
|
||||
|
||||
result = {}
|
||||
|
|
Loading…
Reference in New Issue