Completed
Pull Request — develop (#236)
by
unknown
06:38 queued 03:11
created

applyNewInstitutionConfigurationCreatedEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * Copyright 2016 SURFnet B.V.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace Surfnet\Stepup\Configuration;
20
21
use Broadway\EventSourcing\EventSourcedAggregateRoot;
22
use Surfnet\Stepup\Configuration\Api\InstitutionConfiguration as InstitutionConfigurationInterface;
23
use Surfnet\Stepup\Configuration\Entity\RaLocation;
24
use Surfnet\Stepup\Configuration\Event\AllowedSecondFactorListUpdatedEvent;
25
use Surfnet\Stepup\Configuration\Event\InstitutionConfigurationRemovedEvent;
26
use Surfnet\Stepup\Configuration\Event\NewInstitutionConfigurationCreatedEvent;
27
use Surfnet\Stepup\Configuration\Event\NumberOfTokensPerIdentityOptionChangedEvent;
28
use Surfnet\Stepup\Configuration\Event\RaLocationAddedEvent;
29
use Surfnet\Stepup\Configuration\Event\RaLocationContactInformationChangedEvent;
30
use Surfnet\Stepup\Configuration\Event\RaLocationRelocatedEvent;
31
use Surfnet\Stepup\Configuration\Event\RaLocationRemovedEvent;
32
use Surfnet\Stepup\Configuration\Event\RaLocationRenamedEvent;
33
use Surfnet\Stepup\Configuration\Event\SelectRaaOptionChangedEvent;
34
use Surfnet\Stepup\Configuration\Event\ShowRaaContactInformationOptionChangedEvent;
35
use Surfnet\Stepup\Configuration\Event\UseRaaOptionChangedEvent;
36
use Surfnet\Stepup\Configuration\Event\UseRaLocationsOptionChangedEvent;
37
use Surfnet\Stepup\Configuration\Event\UseRaOptionChangedEvent;
38
use Surfnet\Stepup\Configuration\Event\VerifyEmailOptionChangedEvent;
39
use Surfnet\Stepup\Configuration\Value\AllowedSecondFactorList;
40
use Surfnet\Stepup\Configuration\Value\ContactInformation;
41
use Surfnet\Stepup\Configuration\Value\Institution;
42
use Surfnet\Stepup\Configuration\Value\InstitutionConfigurationId;
43
use Surfnet\Stepup\Configuration\Value\InstitutionRole;
44
use Surfnet\Stepup\Configuration\Value\Location;
45
use Surfnet\Stepup\Configuration\Value\NumberOfTokensPerIdentityOption;
46
use Surfnet\Stepup\Configuration\Value\RaLocationId;
47
use Surfnet\Stepup\Configuration\Value\RaLocationList;
48
use Surfnet\Stepup\Configuration\Value\RaLocationName;
49
use Surfnet\Stepup\Configuration\Value\ShowRaaContactInformationOption;
50
use Surfnet\Stepup\Configuration\Value\UseRaLocationsOption;
51
use Surfnet\Stepup\Configuration\Value\InstitutionAuthorizationOption;
52
use Surfnet\Stepup\Configuration\Value\VerifyEmailOption;
53
use Surfnet\Stepup\Exception\DomainException;
54
55
/**
56
 * InstitutionConfiguration aggregate root
57
 *
58
 * Some things to know about this aggregate:
59
 *
60
 * 1. The aggregate is instantiated by InstitutionConfigurationCommandHandler by calling the
61
 *    handleReconfigureInstitutionConfigurationOptionsCommand method. It does so, not by using the projections to build
62
 *    the aggregate but by playing the events onto the aggregate.
63
 * 2. If one of the configuration options should be nullable, take a look at the applyUseRaOptionChangedEvent doc block
64
 *
65
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects) Events and value objects
66
 * @SuppressWarnings(PHPMD.TooManyMethods) AggregateRoot
67
 * @SuppressWarnings(PHPMD.TooManyPublicMethods) AggregateRoot
68
 */
69
class InstitutionConfiguration extends EventSourcedAggregateRoot implements InstitutionConfigurationInterface
70
{
71
    /**
72
     * @var InstitutionConfigurationId
73
     */
74
    private $institutionConfigurationId;
75
76
    /**
77
     * @var Institution
78
     */
79
    private $institution;
80
81
    /**
82
     * @var RaLocationList
83
     */
84
    private $raLocations;
85
86
    /**
87
     * @var UseRaLocationsOption
88
     */
89
    private $useRaLocationsOption;
90
91
    /**
92
     * @var ShowRaaContactInformationOption
93
     */
94
    private $showRaaContactInformationOption;
95
96
    /**
97
     * @var VerifyEmailOption
98
     */
99
    private $verifyEmailOption;
100
101
    /**
102
     * @var NumberOfTokensPerIdentityOption
103
     */
104
    private $numberOfTokensPerIdentityOption;
105
106
    /**
107
     * @var InstitutionAuthorizationOption
108
     */
109
    private $useRaOption;
110
111
    /**
112
     * @var InstitutionAuthorizationOption
113
     */
114
115
    private $useRaaOption;
116
117
    /**
118
     * @var InstitutionAuthorizationOption
119
     */
120
    private $selectRaaOption;
121
122
    /**
123
     * @var AllowedSecondFactorList
124
     */
125
    private $allowedSecondFactorList;
126
127
    /**
128
     * @var boolean
129
     */
130
    private $isMarkedAsDestroyed;
131
132
    /**
133
     * @param InstitutionConfigurationId $institutionConfigurationId
134
     * @param Institution $institution
135
     * @return InstitutionConfiguration
136
     */
137
    public static function create(InstitutionConfigurationId $institutionConfigurationId, Institution $institution)
138
    {
139
        $institutionConfiguration = new self;
140
        $institutionConfiguration->apply(
141
            new NewInstitutionConfigurationCreatedEvent(
142
                $institutionConfigurationId,
143
                $institution,
144
                UseRaLocationsOption::getDefault(),
145
                ShowRaaContactInformationOption::getDefault(),
146
                VerifyEmailOption::getDefault(),
147
                NumberOfTokensPerIdentityOption::getDefault()
148
            )
149
        );
150
        $institutionConfiguration->apply(new AllowedSecondFactorListUpdatedEvent(
151
            $institutionConfigurationId,
152
            $institution,
153
            AllowedSecondFactorList::blank()
154
        ));
155
        $institutionConfiguration->apply(
156
            new UseRaOptionChangedEvent(
157
                $institutionConfigurationId,
158
                $institution,
159
                InstitutionAuthorizationOption::getDefault(InstitutionRole::useRa())
160
            )
161
        );
162
        $institutionConfiguration->apply(
163
            new UseRaaOptionChangedEvent(
164
                $institutionConfigurationId,
165
                $institution,
166
                InstitutionAuthorizationOption::getDefault(InstitutionRole::useRaa())
167
            )
168
        );
169
        $institutionConfiguration->apply(
170
            new SelectRaaOptionChangedEvent(
171
                $institutionConfigurationId,
172
                $institution,
173
                InstitutionAuthorizationOption::getDefault(InstitutionRole::selectRaa())
174
            )
175
        );
176
177
        return $institutionConfiguration;
178
    }
179
180
    /**
181
     * @return InstitutionConfiguration
182
     */
183
    public function rebuild()
184
    {
185
        // We can only rebuild a destroyed InstitutionConfiguration, all other cases are not valid
186
        if ($this->isMarkedAsDestroyed !== true) {
187
            throw new DomainException('Cannot rebuild InstitutionConfiguration as it has not been destroyed');
188
        }
189
190
        $this->apply(
191
            new NewInstitutionConfigurationCreatedEvent(
192
                $this->institutionConfigurationId,
193
                $this->institution,
194
                UseRaLocationsOption::getDefault(),
195
                ShowRaaContactInformationOption::getDefault(),
196
                VerifyEmailOption::getDefault(),
197
                NumberOfTokensPerIdentityOption::getDefault()
198
            )
199
        );
200
        $this->apply(new AllowedSecondFactorListUpdatedEvent(
201
            $this->institutionConfigurationId,
202
            $this->institution,
203
            AllowedSecondFactorList::blank()
204
        ));
205
        $this->apply(
206
            new UseRaOptionChangedEvent(
207
                $this->institutionConfigurationId,
208
                $this->institution,
209
                InstitutionAuthorizationOption::getDefault(InstitutionRole::useRa())
210
            )
211
        );
212
        $this->apply(
213
            new UseRaaOptionChangedEvent(
214
                $this->institutionConfigurationId,
215
                $this->institution,
216
                InstitutionAuthorizationOption::getDefault(InstitutionRole::useRaa())
217
            )
218
        );
219
        $this->apply(
220
            new SelectRaaOptionChangedEvent(
221
                $this->institutionConfigurationId,
222
                $this->institution,
223
                InstitutionAuthorizationOption::getDefault(InstitutionRole::selectRaa())
224
            )
225
        );
226
227
        return $this;
228
    }
229
230
    final public function __construct()
231
    {
232
    }
233
234
    public function configureUseRaLocationsOption(UseRaLocationsOption $useRaLocationsOption)
235
    {
236
        if ($this->useRaLocationsOption->equals($useRaLocationsOption)) {
237
            return;
238
        }
239
240
        $this->apply(
241
            new UseRaLocationsOptionChangedEvent(
242
                $this->institutionConfigurationId,
243
                $this->institution,
244
                $useRaLocationsOption
245
            )
246
        );
247
    }
248
249
    public function configureShowRaaContactInformationOption(ShowRaaContactInformationOption $showRaaContactInformationOption)
250
    {
251
        if ($this->showRaaContactInformationOption->equals($showRaaContactInformationOption)) {
252
            return;
253
        }
254
255
        $this->apply(
256
            new ShowRaaContactInformationOptionChangedEvent(
257
                $this->institutionConfigurationId,
258
                $this->institution,
259
                $showRaaContactInformationOption
260
            )
261
        );
262
    }
263
264
    public function configureVerifyEmailOption(VerifyEmailOption $verifyEmailOption)
265
    {
266
        if ($this->verifyEmailOption->equals($verifyEmailOption)) {
267
            return;
268
        }
269
270
        $this->apply(
271
            new VerifyEmailOptionChangedEvent(
272
                $this->institutionConfigurationId,
273
                $this->institution,
274
                $verifyEmailOption
275
            )
276
        );
277
    }
278
279
    public function configureNumberOfTokensPerIdentityOption(
280
        NumberOfTokensPerIdentityOption $numberOfTokensPerIdentityOption
281
    ) {
282
        if ($this->numberOfTokensPerIdentityOption->equals($numberOfTokensPerIdentityOption)) {
283
            return;
284
        }
285
286
        $this->apply(
287
            new NumberOfTokensPerIdentityOptionChangedEvent(
288
                $this->institutionConfigurationId,
289
                $this->institution,
290
                $numberOfTokensPerIdentityOption
291
            )
292
        );
293
    }
294
295 View Code Duplication
    public function updateUseRaOption(InstitutionAuthorizationOption $useRaOption)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
296
    {
297
        if ($this->useRaOption !== null
298
            && $this->useRaOption->equals($useRaOption)
299
        ) {
300
            return;
301
        }
302
303
        $this->apply(
304
            new UseRaOptionChangedEvent(
305
                $this->institutionConfigurationId,
306
                $this->institution,
307
                $useRaOption
308
            )
309
        );
310
    }
311
312 View Code Duplication
    public function updateUseRaaOption(InstitutionAuthorizationOption $useRaaOption)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
313
    {
314
        if ($this->useRaaOption !== null
315
            && $this->useRaaOption->equals($useRaaOption)
316
        ) {
317
            return;
318
        }
319
320
        $this->apply(
321
            new UseRaaOptionChangedEvent(
322
                $this->institutionConfigurationId,
323
                $this->institution,
324
                $useRaaOption
325
            )
326
        );
327
    }
328
329 View Code Duplication
    public function updateSelectRaaOption(InstitutionAuthorizationOption $selectRaaOption)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
330
    {
331
        if ($this->selectRaaOption !== null
332
            && $this->selectRaaOption->equals($selectRaaOption)
333
        ) {
334
            return;
335
        }
336
337
        $this->apply(
338
            new SelectRaaOptionChangedEvent(
339
                $this->institutionConfigurationId,
340
                $this->institution,
341
                $selectRaaOption
342
            )
343
        );
344
    }
345
346
    public function updateAllowedSecondFactorList(AllowedSecondFactorList $allowedSecondFactorList)
347
    {
348
        // AllowedSecondFactorList can be null for InstitutionConfigurations for which this functionality did not exist
349
        if ($this->allowedSecondFactorList !== null
350
            && $this->allowedSecondFactorList->equals($allowedSecondFactorList)
351
        ) {
352
            return;
353
        }
354
355
        $this->apply(
356
            new AllowedSecondFactorListUpdatedEvent(
357
                $this->institutionConfigurationId,
358
                $this->institution,
359
                $allowedSecondFactorList
360
            )
361
        );
362
    }
363
364
    /**
365
     * @param RaLocationId $raLocationId
366
     * @param RaLocationName $raLocationName
367
     * @param Location $location
368
     * @param ContactInformation $contactInformation
369
     */
370
    public function addRaLocation(
371
        RaLocationId $raLocationId,
372
        RaLocationName $raLocationName,
373
        Location $location,
374
        ContactInformation $contactInformation
375
    ) {
376 View Code Duplication
        if ($this->raLocations->containsWithId($raLocationId)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
377
            throw new DomainException(sprintf(
378
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
379
                . ' it is already present',
380
                $raLocationId,
381
                $this->getAggregateRootId()
382
            ));
383
        }
384
385
        $this->apply(new RaLocationAddedEvent(
386
            $this->institutionConfigurationId,
387
            $this->institution,
388
            $raLocationId,
389
            $raLocationName,
390
            $location,
391
            $contactInformation
392
        ));
393
    }
394
395
    /**
396
     * @param RaLocationId $raLocationId
397
     * @param RaLocationName $raLocationName
398
     * @param Location $location
399
     * @param ContactInformation $contactInformation
400
     */
401
    public function changeRaLocation(
402
        RaLocationId $raLocationId,
403
        RaLocationName $raLocationName,
404
        Location $location,
405
        ContactInformation $contactInformation
406
    ) {
407 View Code Duplication
        if (!$this->raLocations->containsWithId($raLocationId)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
408
            throw new DomainException(sprintf(
409
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
410
                . ' it is not present',
411
                $raLocationId,
412
                $this->getAggregateRootId()
413
            ));
414
        }
415
416
        $raLocation = $this->raLocations->getById($raLocationId);
417
418
        if (!$raLocation->getName()->equals($raLocationName)) {
419
            $this->apply(
420
                new RaLocationRenamedEvent($this->institutionConfigurationId, $raLocationId, $raLocationName)
421
            );
422
        }
423
        if (!$raLocation->getLocation()->equals($location)) {
424
            $this->apply(
425
                new RaLocationRelocatedEvent($this->institutionConfigurationId, $raLocationId, $location)
426
            );
427
        }
428
        if (!$raLocation->getContactInformation()->equals($contactInformation)) {
429
            $this->apply(
430
                new RaLocationContactInformationChangedEvent(
431
                    $this->institutionConfigurationId,
432
                    $raLocationId,
433
                    $contactInformation
434
                )
435
            );
436
        }
437
    }
438
439
    /**
440
     * @param RaLocationId $raLocationId
441
     */
442
    public function removeRaLocation(RaLocationId $raLocationId)
443
    {
444 View Code Duplication
        if (!$this->raLocations->containsWithId($raLocationId)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
445
            throw new DomainException(sprintf(
446
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
447
                . ' it is not present',
448
                $raLocationId,
449
                $this->getAggregateRootId()
450
            ));
451
        }
452
453
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
454
    }
455
456
    /**
457
     * @return void
458
     */
459
    public function destroy()
460
    {
461
        $this->apply(new InstitutionConfigurationRemovedEvent($this->institutionConfigurationId, $this->institution));
462
    }
463
464
    public function getAggregateRootId()
465
    {
466
        return $this->institutionConfigurationId;
467
    }
468
469
    protected function applyNewInstitutionConfigurationCreatedEvent(NewInstitutionConfigurationCreatedEvent $event)
470
    {
471
        $this->institutionConfigurationId      = $event->institutionConfigurationId;
472
        $this->institution                     = $event->institution;
473
        $this->useRaLocationsOption            = $event->useRaLocationsOption;
474
        $this->showRaaContactInformationOption = $event->showRaaContactInformationOption;
475
        $this->verifyEmailOption               = $event->verifyEmailOption;
476
        $this->numberOfTokensPerIdentityOption = $event->numberOfTokensPerIdentityOption;
477
        $this->raLocations                     = new RaLocationList([]);
478
        $this->isMarkedAsDestroyed             = false;
479
    }
480
481
    /**
482
     * Apply the UseRaOptionChangedEvent
483
     *
484
     * To ensure the aggregate is correctly populated with the FGA options we ensure the UseRaOptionChangedEvent
485
     * can be applied on the aggregate. Refraining from doing this would result in the $this->useRaOption field only
486
     * being applied when applyNewInstitutionConfigurationCreatedEvent is called. And this might not be the case if
487
     * the fields where null'ed (removed from configuration).
488
     *
489
     * This also applies for applyUseRaaOptionChangedEvent & applySelectRaaOptionChangedEvent
490
     *
491
     * @param UseRaOptionChangedEvent $event
492
     */
493
    protected function applyUseRaOptionChangedEvent(UseRaOptionChangedEvent $event)
494
    {
495
        $this->useRaOption = $event->useRaOption;
496
    }
497
498
    protected function applyUseRaaOptionChangedEvent(UseRaaOptionChangedEvent $event)
499
    {
500
        $this->useRaaOption = $event->useRaaOption;
501
    }
502
503
    protected function applySelectRaaOptionChangedEvent(SelectRaaOptionChangedEvent $event)
504
    {
505
        $this->selectRaaOption = $event->selectRaaOption;
506
    }
507
508
    protected function applyUseRaLocationsOptionChangedEvent(UseRaLocationsOptionChangedEvent $event)
509
    {
510
        $this->useRaLocationsOption = $event->useRaLocationsOption;
511
    }
512
513
    protected function applyShowRaaContactInformationOptionChangedEvent(
514
        ShowRaaContactInformationOptionChangedEvent $event
515
    ) {
516
        $this->showRaaContactInformationOption = $event->showRaaContactInformationOption;
517
    }
518
519
    protected function applyVerifyEmailOptionChangedEvent(
520
        VerifyEmailOptionChangedEvent $event
521
    ) {
522
        $this->verifyEmailOption = $event->verifyEmailOption;
523
    }
524
525
    protected function applyNumberOfTokensPerIdentityOptionChangedEvent(
526
        NumberOfTokensPerIdentityOptionChangedEvent $event
527
    ) {
528
        $this->numberOfTokensPerIdentityOption = $event->numberOfTokensPerIdentityOption;
529
    }
530
531
    protected function applyAllowedSecondFactorListUpdatedEvent(AllowedSecondFactorListUpdatedEvent $event)
532
    {
533
        $this->allowedSecondFactorList = $event->allowedSecondFactorList;
534
    }
535
536
    protected function applyRaLocationAddedEvent(RaLocationAddedEvent $event)
537
    {
538
        $this->raLocations->add(
539
            RaLocation::create(
540
                $event->raLocationId,
541
                $event->raLocationName,
542
                $event->location,
543
                $event->contactInformation
544
            )
545
        );
546
    }
547
548
    protected function applyRaLocationRenamedEvent(RaLocationRenamedEvent $event)
549
    {
550
        $raLocation = $this->raLocations->getById($event->raLocationId);
551
        $raLocation->rename($event->raLocationName);
552
    }
553
554
    protected function applyRaLocationRelocatedEvent(RaLocationRelocatedEvent $event)
555
    {
556
        $raLocation = $this->raLocations->getById($event->raLocationId);
557
        $raLocation->relocate($event->location);
558
    }
559
560
    protected function applyRaLocationContactInformationChangedEvent(RaLocationContactInformationChangedEvent $event)
561
    {
562
        $raLocation = $this->raLocations->getById($event->raLocationId);
563
        $raLocation->changeContactInformation($event->contactInformation);
564
    }
565
566
    protected function applyRaLocationRemovedEvent(RaLocationRemovedEvent $event)
567
    {
568
        $this->raLocations->removeWithId($event->raLocationId);
569
    }
570
571
    /**
572
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
573
     * @param InstitutionConfigurationRemovedEvent $event
574
     */
575
    protected function applyInstitutionConfigurationRemovedEvent(InstitutionConfigurationRemovedEvent $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
576
    {
577
        // reset all configuration to defaults. This way, should it be rebuild, it seems like it is new again
578
        $this->raLocations                     = new RaLocationList([]);
579
        $this->useRaLocationsOption            = UseRaLocationsOption::getDefault();
580
        $this->showRaaContactInformationOption = ShowRaaContactInformationOption::getDefault();
581
        $this->verifyEmailOption               = VerifyEmailOption::getDefault();
582
        $this->numberOfTokensPerIdentityOption = NumberOfTokensPerIdentityOption::getDefault();
583
        $this->allowedSecondFactorList         = AllowedSecondFactorList::blank();
584
        $this->useRaOption = InstitutionAuthorizationOption::getDefault(InstitutionRole::useRa());
585
        $this->useRaaOption = InstitutionAuthorizationOption::getDefault(InstitutionRole::useRaa());
586
        $this->selectRaaOption = InstitutionAuthorizationOption::getDefault(InstitutionRole::selectRaa());
587
588
        $this->isMarkedAsDestroyed             = true;
589
    }
590
}
591