-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAccess.php
More file actions
172 lines (155 loc) · 4.63 KB
/
Copy pathAccess.php
File metadata and controls
172 lines (155 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
namespace Ds\Component\Acl\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Ds\Component\Acl\Entity\Attribute\Accessor as AclAccessor;
use Ds\Component\Model\Type\Assignable;
use Ds\Component\Model\Type\Identifiable;
use Ds\Component\Model\Type\Uuidentifiable;
use Ds\Component\Model\Type\Ownable;
use Ds\Component\Model\Type\Versionable;
use Ds\Component\Model\Attribute\Accessor;
use Ds\Component\Tenant\Model\Attribute\Accessor as TenantAccessor;
use Ds\Component\Tenant\Model\Type\Tenantable;
use Knp\DoctrineBehaviors\Model as Behavior;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiProperty;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints as ORMAssert;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class Access
*
* @package Ds\Component\Acl
* @ApiResource(
* attributes={
* "normalization_context"={
* "groups"={"access_output", "permission_output"}
* },
* "denormalization_context"={
* "groups"={"access_input", "permission_input"}
* },
* "filters"={
* "ds_acl.access.search",
* "ds_acl.access.date"
* }
* }
* )
* @ORM\Entity(repositoryClass="Ds\Component\Acl\Repository\AccessRepository")
* @ORM\Table(name="ds_access")
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
* @ORMAssert\UniqueEntity(fields="uuid")
*/
class Access implements Identifiable, Uuidentifiable, Ownable, Assignable, Versionable, Tenantable
{
use Behavior\Timestampable\Timestampable;
use Accessor\Id;
use Accessor\Uuid;
use Accessor\Owner;
use Accessor\OwnerUuid;
use Accessor\Assignee;
use Accessor\AssigneeUuid;
use AclAccessor\Permissions;
use AclAccessor\Access;
use Accessor\Version;
use TenantAccessor\Tenant;
/**
* @var integer
* @ApiProperty(identifier=false, writable=false)
* @Serializer\Groups({"access_output"})
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(name="id", type="integer")
*/
private $id;
/**
* @var string
* @ApiProperty(identifier=true, writable=false)
* @Serializer\Groups({"access_output"})
* @ORM\Column(name="uuid", type="guid", unique=true)
* @Assert\Uuid
*/
private $uuid;
/**
* @var \DateTime
* @ApiProperty
* @Serializer\Groups({"access_output", "access_input"})
* @Assert\DateTime
*/
protected $createdAt;
/**
* @var \DateTime
* @ApiProperty(writable=false)
* @Serializer\Groups({"access_output"})
*/
protected $updatedAt;
/**
* @var string
* @ApiProperty
* @Serializer\Groups({"access_output", "access_input"})
* @ORM\Column(name="`owner`", type="string", length=255, nullable=true)
* @Assert\NotBlank
* @Assert\Length(min=1, max=255)
*/
private $owner;
/**
* @var string
* @ApiProperty
* @Serializer\Groups({"access_output", "access_input"})
* @ORM\Column(name="owner_uuid", type="guid", nullable=true)
* @Assert\NotBlank
* @Assert\Uuid
*/
private $ownerUuid;
/**
* @var string
* @ApiProperty
* @Serializer\Groups({"access_output", "access_input"})
* @ORM\Column(name="assignee", type="string", length=255, nullable=true)
* @Assert\NotBlank
* @Assert\Length(min=1, max=255)
*/
private $assignee;
/**
* @var string
* @ApiProperty
* @Serializer\Groups({"access_output", "access_input"})
* @ORM\Column(name="assignee_uuid", type="guid", nullable=true)
* @Assert\Uuid
*/
private $assigneeUuid;
/**
* @var \Doctrine\Common\Collections\ArrayCollection
* @ApiProperty
* @Serializer\Groups({"access_output", "access_input"})
* @ORM\OneToMany(targetEntity="Permission", mappedBy="access", cascade={"persist", "remove"}, fetch="EAGER")
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
* @Assert\Valid
*/
private $permissions;
/**
* @var integer
* @ApiProperty
* @Serializer\Groups({"access_output", "access_input"})
* @ORM\Column(name="version", type="integer")
* @ORM\Version
* @Assert\NotBlank
* @Assert\Type("integer")
*/
private $version;
/**
* @var string
* @ApiProperty
* @Serializer\Groups({"access_output"})
* @ORM\Column(name="tenant", type="guid")
* @Assert\Uuid
*/
private $tenant;
/**
* Constructor
*/
public function __construct()
{
$this->permissions = new ArrayCollection;
}
}