22 lines
632 B
PHP
22 lines
632 B
PHP
<?php
|
|
require __DIR__ . '/_bootstrap.php';
|
|
|
|
/**
|
|
* @OA\Get(
|
|
* path="/sharing-roles.php",
|
|
* tags={"Reference"},
|
|
* summary="Sharing roles reference",
|
|
* security={{"bearerAuth":{}}},
|
|
* @OA\Response(response=200, description="OK", @OA\JsonContent(
|
|
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/SharingRole"))
|
|
* )),
|
|
* @OA\Response(response=401, ref="#/components/responses/Unauthorized")
|
|
* )
|
|
*/
|
|
require_method('GET');
|
|
require_auth($pdo);
|
|
|
|
$stmt = $pdo->query('SELECT * FROM sharing_roles ORDER BY idrole');
|
|
|
|
json_data(array_map('present_sharing_role', $stmt->fetchAll()));
|