• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 14304969316

07 Apr 2025 08:53AM UTC coverage: 7.281% (-1.2%) from 8.52%
14304969316

push

github

soyuka
Merge 4.1

13 of 244 new or added lines in 12 files covered. (5.33%)

222 existing lines in 2 files now uncovered.

10878 of 149412 relevant lines covered (7.28%)

6.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/tests/Fixtures/TestBundle/Document/SecuredDummyCollection.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Tests\Fixtures\TestBundle\Document;
15

16
use ApiPlatform\Metadata\ApiProperty;
17
use ApiPlatform\Metadata\ApiResource;
18
use ApiPlatform\Metadata\GraphQl\Query;
19
use ApiPlatform\Metadata\GraphQl\QueryCollection;
20
use ApiPlatform\Metadata\NotExposed;
21
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
22

23
/**
24
 * Secured resource.
25
 */
26
#[ApiResource(
NEW
27
    operations: [
×
NEW
28
        new NotExposed(),
×
NEW
29
    ],
×
NEW
30
    graphQlOperations: [
×
NEW
31
        new Query(),
×
NEW
32
        new QueryCollection(),
×
NEW
33
    ],
×
NEW
34
    security: 'is_granted(\'ROLE_USER\')'
×
NEW
35
)]
×
36
#[ODM\Document]
37
class SecuredDummyCollection
38
{
39
    #[ODM\Id(strategy: 'INCREMENT', type: 'int')]
40
    public ?int $id = null;
41

42
    /**
43
     * @var string The title
44
     */
45
    #[ODM\Field]
46
    public string $title;
47

48
    /**
49
     * @var string Secret property, only readable/writable by owners
50
     */
51
    #[ApiProperty(security: 'object == null or object.owner == user', securityPostDenormalize: 'object.owner == user')]
52
    #[ODM\Field]
53
    public ?string $ownerOnlyProperty = null;
54

55
    /**
56
     * @var string The owner
57
     */
58
    #[ODM\Field]
59
    public string $owner;
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc