FEATURE: Make allow_uploaded_avatars accept TL (#14091)

This gives admins more control over who can upload custom profile
pictures.
This commit is contained in:
Bianca Nenciu
2021-08-24 10:46:28 +03:00
committed by GitHub
parent eb6d66fe6f
commit ff367e22fb
12 changed files with 122 additions and 14 deletions

View File

@ -1138,7 +1138,7 @@ class UsersController < ApplicationController
if type.blank? || type == 'system'
upload_id = nil
elsif !SiteSetting.allow_uploaded_avatars
elsif !TrustLevelAndStaffAndDisabledSetting.matches?(SiteSetting.allow_uploaded_avatars, user)
return render json: failed_json, status: 422
else
upload_id = params[:upload_id]