Fix api endpoints

This commit is contained in:
Daniel Supernault 2024-02-09 20:51:37 -07:00
parent fd7f5dbba1
commit 62b9eef805
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
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')