Skip to content

Commit

Permalink
pkp#10328 Refactor Announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed Sep 2, 2024
1 parent e1cec28 commit 414b07c
Show file tree
Hide file tree
Showing 15 changed files with 862 additions and 598 deletions.
17 changes: 17 additions & 0 deletions api/v1/_submissions/PKPBackendSubmissionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Route;
use PKP\announcement\Announcement;
use PKP\API\v1\submissions\AnonymizeData;
use PKP\config\Config;
use PKP\core\PKPBaseController;
Expand Down Expand Up @@ -141,6 +142,15 @@ public function getGroupRoutes(): void
Role::ROLE_ID_REVIEWER,
])
]);

// Endpoint for testing new User Model; TODO remove before merging
Route::get('testUserModel', $this->getTestUsers(...))
->name('_submission.getTestUsers')
->middleware([
self::roleAuthorizer([
Role::ROLE_ID_MANAGER,
])
]);
}
}

Expand Down Expand Up @@ -508,4 +518,11 @@ protected function canAccessAllSubmissions(): bool
$userRoles = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_USER_ROLES);
return !empty(array_intersect([Role::ROLE_ID_SITE_ADMIN, Role::ROLE_ID_MANAGER], $userRoles));
}

public function getTestUsers(Request $illuminateRequest): JsonResponse
{
$announcement = Announcement::find(1);

return response()->json($announcement->datePosted, Response::HTTP_OK);
}
}
Loading

0 comments on commit 414b07c

Please sign in to comment.