mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Fixed API Platform deprecations
This commit is contained in:
parent
d0a5b4dcd7
commit
717a9fb0a3
18 changed files with 72 additions and 29 deletions
|
@ -31,6 +31,7 @@ use ApiPlatform\Metadata\ApiResource;
|
|||
use ApiPlatform\Metadata\Get;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use ApiPlatform\OpenApi\Model\Operation;
|
||||
use ApiPlatform\Serializer\Filter\PropertyFilter;
|
||||
use App\ApiPlatform\Filter\LikeFilter;
|
||||
use App\Entity\Attachments\Attachment;
|
||||
|
@ -86,10 +87,14 @@ use Jbtronics\TFAWebauthn\Model\TwoFactorInterface as WebauthnTwoFactorInterface
|
|||
#[ApiResource(
|
||||
shortName: 'User',
|
||||
operations: [
|
||||
new Get(openapiContext: ['summary' => 'Get a specific user.'],
|
||||
security: 'is_granted("read", object)'),
|
||||
new GetCollection(openapiContext: ['summary' => 'Get all users defined in the system.'],
|
||||
security: 'is_granted("@users.read")'),
|
||||
new Get(
|
||||
openapi: new Operation(summary: 'Get information about the current user.'),
|
||||
security: 'is_granted("read", object)'
|
||||
),
|
||||
new GetCollection(
|
||||
openapi: new Operation(summary: 'Get all users defined in the system.'),
|
||||
security: 'is_granted("@users.read")'
|
||||
),
|
||||
],
|
||||
normalizationContext: ['groups' => ['user:read'], 'openapi_definition_name' => 'Read'],
|
||||
)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue