用户功能设置收口与废弃后台链路清理
This commit is contained in:
@@ -54,8 +54,10 @@ trait UserControllerProfileMediaOperations {
|
||||
return $this->error(__('请先登录', 'aksrt'), 401);
|
||||
}
|
||||
|
||||
$capability = $is_avatar ? 'upload_avatar' : 'upload_profile_background';
|
||||
if (!function_exists('aksrt_user_can') || !aksrt_user_can($capability, $user_id)) {
|
||||
$upload_enabled = $is_avatar
|
||||
? function_exists('aksrt_is_avatar_upload_enabled') && aksrt_is_avatar_upload_enabled()
|
||||
: function_exists('aksrt_is_user_cover_upload_enabled') && aksrt_is_user_cover_upload_enabled();
|
||||
if (!$upload_enabled) {
|
||||
return $this->error($is_avatar
|
||||
? __('当前账号没有上传头像的权限', 'aksrt')
|
||||
: __('当前账号没有上传用户资料卡背景图的权限', 'aksrt'), 403);
|
||||
|
||||
Reference in New Issue
Block a user