Merge pull request #4914 from pixelfed/staging

Fix api endpoints
This commit is contained in:
daniel 2024-02-09 20:52:09 -07:00 committed by GitHub
commit 8ab9951909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -956,8 +956,7 @@ class ApiV1Controller extends Controller
*/
public function accountRelationshipsById(Request $request)
{
abort_if(!$request->user() || !$request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
abort_if(!$request->user(), 403);
$this->validate($request, [
'id' => 'required|array|min:1|max:20',

View file

@ -260,6 +260,8 @@ class ComposeController extends Controller
$q = mb_substr($q, 1);
}
$user = $request->user();
abort_if($user->has_roles && !UserRoleService::can('can-post', $user->id), 403, 'Invalid permissions for this action');
$blocked = UserFilter::whereFilterableType('App\Profile')