77use Psr \Http \Message \ServerRequestInterface as Request ;
88use DBA \Factory ;
99use DBA \Hash ;
10+ use DBA \Hashlist ;
1011use DBA \QueryFilter ;
1112use DBA \Task ;
1213use Middlewares \Utils \HttpErrorException ;
1314
1415require_once (dirname (__FILE__ ) . "/../common/AbstractHelperAPI.class.php " );
1516
16- class getCracksOfTaskHelper extends AbstractHelperAPI {
17+ class GetCracksOfTaskHelper extends AbstractHelperAPI {
1718 public static function getBaseUri (): string {
1819 return "/api/v2/helper/getCracksOfTask " ;
1920 }
@@ -23,7 +24,7 @@ public static function getAvailableMethods(): array {
2324 }
2425
2526 public function getRequiredPermissions (string $ method ): array {
26- return [Hash::PERM_READ , Task::PERM_READ ];
27+ return [Hashlist:: PERM_READ , Hash::PERM_READ , Task::PERM_READ ];
2728 }
2829
2930 public static function getResponse (): null {
@@ -63,7 +64,7 @@ public function getParamsSwagger(): array {
6364 */
6465 public function handleGet (Request $ request , Response $ response ): Response {
6566 $ this ->preCommon ($ request );
66- $ task = Factory::getTaskFactory ()->get ($ _GET ['task ' ]);
67+ $ task = Factory::getTaskFactory ()->get ($ request -> getQueryParams () ['task ' ]);
6768 if ($ task == null ) {
6869 throw new HttpError ("No task has been found with provided task id " );
6970 }
@@ -98,7 +99,7 @@ public function handleGet(Request $request, Response $response): Response {
9899 }
99100
100101 static public function register ($ app ): void {
101- $ baseUri = getCracksOfTaskHelper ::getBaseUri ();
102+ $ baseUri = GetCracksOfTaskHelper ::getBaseUri ();
102103
103104 /* Allow CORS preflight requests */
104105 $ app ->options ($ baseUri , function (Request $ request , Response $ response ): Response {
@@ -108,4 +109,4 @@ static public function register($app): void {
108109 }
109110}
110111
111- getCracksOfTaskHelper ::register ($ app );
112+ GetCracksOfTaskHelper ::register ($ app );
0 commit comments