getUser($request))) { throw new AuthorizationFailedException(); } [$offset, $limit] = $this->getOffsetAndLimit(); $total = \MassMail\MassMailPermission::countBySQL('1'); $permissions = \MassMail\MassMailPermission::findBySQL( "JOIN `Institute` ON (`Institute`.`Institut_id` = `massmail_permissions`.`institute_id`) ORDER BY `Institute`.`Name` LIMIT ?, ?", [$offset, $limit]); return $this->getPaginatedContentResponse($permissions, $total); } }