Completed
Push — feature/fine-grained-authoriza... ( 5fbefa )
by
unknown
02:52
created

configureNumberOfTokensPerIdentityOption()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 2
nc 2
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
 * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) AggregateRoot
69
 */
70
class InstitutionConfiguration extends EventSourcedAggregateRoot implements InstitutionConfigurationInterface
71
{
72
    /**
73
     * @var InstitutionConfigurationId
74
     */
75
    private $institutionConfigurationId;
76
77
    /**
78
     * @var Institution
79
     */
80
    private $institution;
81
82
    /**
83
     * @var RaLocationList
84
     */
85
    private $raLocations;
86
87
    /**
88
     * @var UseRaLocationsOption
89
     */
90
    private $useRaLocationsOption;
91
92
    /**
93
     * @var ShowRaaContactInformationOption
94
     */
95
    private $showRaaContactInformationOption;
96
97
    /**
98
     * @var VerifyEmailOption
99
     */
100
    private $verifyEmailOption;
101
102
    /**
103
     * @var NumberOfTokensPerIdentityOption
104
     */
105
    private $numberOfTokensPerIdentityOption;
106
107
    /**
108
     * @var InstitutionAuthorizationOption
109
     */
110
    private $useRaOption;
111
112
    /**
113
     * @var InstitutionAuthorizationOption
114
     */
115
116
    private $useRaaOption;
117
118
    /**
119
     * @var InstitutionAuthorizationOption
120
     */
121
    private $selectRaaOption;
122
123
    /**
124
     * @var AllowedSecondFactorList
125
     */
126
    private $allowedSecondFactorList;
127
128
    /**
129
     * @var boolean
130
     */
131
    private $isMarkedAsDestroyed;
132
133
    /**
134
     * @param InstitutionConfigurationId $institutionConfigurationId
135
     * @param Institution $institution
136
     * @return InstitutionConfiguration
137
     */
138
    public static function create(InstitutionConfigurationId $institutionConfigurationId, Institution $institution)
139
    {
140
        $institutionConfiguration = new self;
141
        $institutionConfiguration->apply(
142
            new NewInstitutionConfigurationCreatedEvent(
143
                $institutionConfigurationId,
144
                $institution,
145
                UseRaLocationsOption::getDefault(),
146
                ShowRaaContactInformationOption::getDefault(),
147
                VerifyEmailOption::getDefault(),
148
                NumberOfTokensPerIdentityOption::getDefault()
149
            )
150
        );
151
        $institutionConfiguration->apply(new AllowedSecondFactorListUpdatedEvent(
152
            $institutionConfigurationId,
153
            $institution,
154
            AllowedSecondFactorList::blank()
155
        ));
156
        $institutionConfiguration->apply(
157
            new UseRaOptionChangedEvent(
158
                $institutionConfigurationId,
159
                $institution,
160
                InstitutionAuthorizationOption::getDefault(InstitutionRole::useRa())
161
            )
162
        );
163
        $institutionConfiguration->apply(
164
            new UseRaaOptionChangedEvent(
165
                $institutionConfigurationId,
166
                $institution,
167
                InstitutionAuthorizationOption::getDefault(InstitutionRole::useRaa())
168
            )
169
        );
170
        $institutionConfiguration->apply(
171
            new SelectRaaOptionChangedEvent(
172
                $institutionConfigurationId,
173
                $institution,
174
                InstitutionAuthorizationOption::getDefault(InstitutionRole::selectRaa())
175
            )
176
        );
177
178
        return $institutionConfiguration;
179
    }
180
181
    /**
182
     * @return InstitutionConfiguration
183
     */
184
    public function rebuild()
185
    {
186
        // We can only rebuild a destroyed InstitutionConfiguration, all other cases are not valid
187
        if ($this->isMarkedAsDestroyed !== true) {
188
            throw new DomainException('Cannot rebuild InstitutionConfiguration as it has not been destroyed');
189
        }
190
191
        $this->apply(
192
            new NewInstitutionConfigurationCreatedEvent(
193
                $this->institutionConfigurationId,
194
                $this->institution,
195
                UseRaLocationsOption::getDefault(),
196
                ShowRaaContactInformationOption::getDefault(),
197
                VerifyEmailOption::getDefault(),
198
                NumberOfTokensPerIdentityOption::getDefault()
199
            )
200
        );
201
        $this->apply(new AllowedSecondFactorListUpdatedEvent(
202
            $this->institutionConfigurationId,
203
            $this->institution,
204
            AllowedSecondFactorList::blank()
205
        ));
206
        $this->apply(
207
            new UseRaOptionChangedEvent(
208
                $this->institutionConfigurationId,
209
                $this->institution,
210
                InstitutionAuthorizationOption::getDefault(InstitutionRole::useRa())
211
            )
212
        );
213
        $this->apply(
214
            new UseRaaOptionChangedEvent(
215
                $this->institutionConfigurationId,
216
                $this->institution,
217
                InstitutionAuthorizationOption::getDefault(InstitutionRole::useRaa())
218
            )
219
        );
220
        $this->apply(
221
            new SelectRaaOptionChangedEvent(
222
                $this->institutionConfigurationId,
223
                $this->institution,
224
                InstitutionAuthorizationOption::getDefault(InstitutionRole::selectRaa())
225
            )
226
        );
227
228
        return $this;
229
    }
230
231
    final public function __construct()
232
    {
233
    }
234
235
    public function configureUseRaLocationsOption(UseRaLocationsOption $useRaLocationsOption)
236
    {
237
        if ($this->useRaLocationsOption->equals($useRaLocationsOption)) {
238
            return;
239
        }
240
241
        $this->apply(
242
            new UseRaLocationsOptionChangedEvent(
243
                $this->institutionConfigurationId,
244
                $this->institution,
245
                $useRaLocationsOption
246
            )
247
        );
248
    }
249
250
    public function configureShowRaaContactInformationOption(ShowRaaContactInformationOption $showRaaContactInformationOption)
251
    {
252
        if ($this->showRaaContactInformationOption->equals($showRaaContactInformationOption)) {
253
            return;
254
        }
255
256
        $this->apply(
257
            new ShowRaaContactInformationOptionChangedEvent(
258
                $this->institutionConfigurationId,
259
                $this->institution,
260
                $showRaaContactInformationOption
261
            )
262
        );
263
    }
264
265
    public function configureVerifyEmailOption(VerifyEmailOption $verifyEmailOption)
266
    {
267
        if ($this->verifyEmailOption->equals($verifyEmailOption)) {
268
            return;
269
        }
270
271
        $this->apply(
272
            new VerifyEmailOptionChangedEvent(
273
                $this->institutionConfigurationId,
274
                $this->institution,
275
                $verifyEmailOption
276
            )
277
        );
278
    }
279
280
    public function configureNumberOfTokensPerIdentityOption(
281
        NumberOfTokensPerIdentityOption $numberOfTokensPerIdentityOption
282
    ) {
283
        if ($this->numberOfTokensPerIdentityOption->equals($numberOfTokensPerIdentityOption)) {
284
            return;
285
        }
286
287
        $this->apply(
288
            new NumberOfTokensPerIdentityOptionChangedEvent(
289
                $this->institutionConfigurationId,
290
                $this->institution,
291
                $numberOfTokensPerIdentityOption
292
            )
293
        );
294
    }
295
296 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...
297
    {
298
        if ($this->useRaOption !== null
299
            && $this->useRaOption->equals($useRaOption)
300
        ) {
301
            return;
302
        }
303
304
        $this->apply(
305
            new UseRaOptionChangedEvent(
306
                $this->institutionConfigurationId,
307
                $this->institution,
308
                $useRaOption
309
            )
310
        );
311
    }
312
313 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...
314
    {
315
        if ($this->useRaaOption !== null
316
            && $this->useRaaOption->equals($useRaaOption)
317
        ) {
318
            return;
319
        }
320
321
        $this->apply(
322
            new UseRaaOptionChangedEvent(
323
                $this->institutionConfigurationId,
324
                $this->institution,
325
                $useRaaOption
326
            )
327
        );
328
    }
329
330 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...
331
    {
332
        if ($this->selectRaaOption !== null
333
            && $this->selectRaaOption->equals($selectRaaOption)
334
        ) {
335
            return;
336
        }
337
338
        $this->apply(
339
            new SelectRaaOptionChangedEvent(
340
                $this->institutionConfigurationId,
341
                $this->institution,
342
                $selectRaaOption
343
            )
344
        );
345
    }
346
347
    public function updateAllowedSecondFactorList(AllowedSecondFactorList $allowedSecondFactorList)
348
    {
349
        // AllowedSecondFactorList can be null for InstitutionConfigurations for which this functionality did not exist
350
        if ($this->allowedSecondFactorList !== null
351
            && $this->allowedSecondFactorList->equals($allowedSecondFactorList)
352
        ) {
353
            return;
354
        }
355
356
        $this->apply(
357
            new AllowedSecondFactorListUpdatedEvent(
358
                $this->institutionConfigurationId,
359
                $this->institution,
360
                $allowedSecondFactorList
361
            )
362
        );
363
    }
364
365
    /**
366
     * @param RaLocationId $raLocationId
367
     * @param RaLocationName $raLocationName
368
     * @param Location $location
369
     * @param ContactInformation $contactInformation
370
     */
371
    public function addRaLocation(
372
        RaLocationId $raLocationId,
373
        RaLocationName $raLocationName,
374
        Location $location,
375
        ContactInformation $contactInformation
376
    ) {
377 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...
378
            throw new DomainException(sprintf(
379
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
380
                . ' it is already present',
381
                $raLocationId,
382
                $this->getAggregateRootId()
383
            ));
384
        }
385
386
        $this->apply(new RaLocationAddedEvent(
387
            $this->institutionConfigurationId,
388
            $this->institution,
389
            $raLocationId,
390
            $raLocationName,
391
            $location,
392
            $contactInformation
393
        ));
394
    }
395
396
    /**
397
     * @param RaLocationId $raLocationId
398
     * @param RaLocationName $raLocationName
399
     * @param Location $location
400
     * @param ContactInformation $contactInformation
401
     */
402
    public function changeRaLocation(
403
        RaLocationId $raLocationId,
404
        RaLocationName $raLocationName,
405
        Location $location,
406
        ContactInformation $contactInformation
407
    ) {
408 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...
409
            throw new DomainException(sprintf(
410
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
411
                . ' it is not present',
412
                $raLocationId,
413
                $this->getAggregateRootId()
414
            ));
415
        }
416
417
        $raLocation = $this->raLocations->getById($raLocationId);
418
419
        if (!$raLocation->getName()->equals($raLocationName)) {
420
            $this->apply(
421
                new RaLocationRenamedEvent($this->institutionConfigurationId, $raLocationId, $raLocationName)
422
            );
423
        }
424
        if (!$raLocation->getLocation()->equals($location)) {
425
            $this->apply(
426
                new RaLocationRelocatedEvent($this->institutionConfigurationId, $raLocationId, $location)
427
            );
428
        }
429
        if (!$raLocation->getContactInformation()->equals($contactInformation)) {
430
            $this->apply(
431
                new RaLocationContactInformationChangedEvent(
432
                    $this->institutionConfigurationId,
433
                    $raLocationId,
434
                    $contactInformation
435
                )
436
            );
437
        }
438
    }
439
440
    /**
441
     * @param RaLocationId $raLocationId
442
     */
443
    public function removeRaLocation(RaLocationId $raLocationId)
444
    {
445 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...
446
            throw new DomainException(sprintf(
447
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
448
                . ' it is not present',
449
                $raLocationId,
450
                $this->getAggregateRootId()
451
            ));
452
        }
453
454
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
455
    }
456
457
    /**
458
     * @return void
459
     */
460
    public function destroy()
461
    {
462
        $this->apply(new InstitutionConfigurationRemovedEvent($this->institutionConfigurationId, $this->institution));
463
    }
464
465
    public function getAggregateRootId()
466
    {
467
        return $this->institutionConfigurationId;
468
    }
469
470
    protected function applyNewInstitutionConfigurationCreatedEvent(NewInstitutionConfigurationCreatedEvent $event)
471
    {
472
        $this->institutionConfigurationId      = $event->institutionConfigurationId;
473
        $this->institution                     = $event->institution;
474
        $this->useRaLocationsOption            = $event->useRaLocationsOption;
475
        $this->showRaaContactInformationOption = $event->showRaaContactInformationOption;
476
        $this->verifyEmailOption               = $event->verifyEmailOption;
477
        $this->numberOfTokensPerIdentityOption = $event->numberOfTokensPerIdentityOption;
478
        $this->raLocations                     = new RaLocationList([]);
479
        $this->isMarkedAsDestroyed             = false;
480
    }
481
482
    /**
483
     * Apply the UseRaOptionChangedEvent
484
     *
485
     * To ensure the aggregate is correctly populated with the FGA options we ensure the UseRaOptionChangedEvent
486
     * can be applied on the aggregate. Refraining from doing this would result in the $this->useRaOption field only
487
     * being applied when applyNewInstitutionConfigurationCreatedEvent is called. And this might not be the case if
488
     * the fields where null'ed (removed from configuration).
489
     *
490
     * This also applies for applyUseRaaOptionChangedEvent & applySelectRaaOptionChangedEvent
491
     *
492
     * @param UseRaOptionChangedEvent $event
493
     */
494
    protected function applyUseRaOptionChangedEvent(UseRaOptionChangedEvent $event)
495
    {
496
        $this->useRaOption = $event->useRaOption;
497
    }
498
499
    protected function applyUseRaaOptionChangedEvent(UseRaaOptionChangedEvent $event)
500
    {
501
        $this->useRaaOption = $event->useRaaOption;
502
    }
503
504
    protected function applySelectRaaOptionChangedEvent(SelectRaaOptionChangedEvent $event)
505
    {
506
        $this->selectRaaOption = $event->selectRaaOption;
507
    }
508
509
    protected function applyUseRaLocationsOptionChangedEvent(UseRaLocationsOptionChangedEvent $event)
510
    {
511
        $this->useRaLocationsOption = $event->useRaLocationsOption;
512
    }
513
514
    protected function applyShowRaaContactInformationOptionChangedEvent(
515
        ShowRaaContactInformationOptionChangedEvent $event
516
    ) {
517
        $this->showRaaContactInformationOption = $event->showRaaContactInformationOption;
518
    }
519
520
    protected function applyVerifyEmailOptionChangedEvent(
521
        VerifyEmailOptionChangedEvent $event
522
    ) {
523
        $this->verifyEmailOption = $event->verifyEmailOption;
524
    }
525
526
    protected function applyNumberOfTokensPerIdentityOptionChangedEvent(
527
        NumberOfTokensPerIdentityOptionChangedEvent $event
528
    ) {
529
        $this->numberOfTokensPerIdentityOption = $event->numberOfTokensPerIdentityOption;
530
    }
531
532
    protected function applyAllowedSecondFactorListUpdatedEvent(AllowedSecondFactorListUpdatedEvent $event)
533
    {
534
        $this->allowedSecondFactorList = $event->allowedSecondFactorList;
535
    }
536
537
    protected function applyRaLocationAddedEvent(RaLocationAddedEvent $event)
538
    {
539
        $this->raLocations->add(
540
            RaLocation::create(
541
                $event->raLocationId,
542
                $event->raLocationName,
543
                $event->location,
544
                $event->contactInformation
545
            )
546
        );
547
    }
548
549
    protected function applyRaLocationRenamedEvent(RaLocationRenamedEvent $event)
550
    {
551
        $raLocation = $this->raLocations->getById($event->raLocationId);
552
        $raLocation->rename($event->raLocationName);
553
    }
554
555
    protected function applyRaLocationRelocatedEvent(RaLocationRelocatedEvent $event)
556
    {
557
        $raLocation = $this->raLocations->getById($event->raLocationId);
558
        $raLocation->relocate($event->location);
559
    }
560
561
    protected function applyRaLocationContactInformationChangedEvent(RaLocationContactInformationChangedEvent $event)
562
    {
563
        $raLocation = $this->raLocations->getById($event->raLocationId);
564
        $raLocation->changeContactInformation($event->contactInformation);
565
    }
566
567
    protected function applyRaLocationRemovedEvent(RaLocationRemovedEvent $event)
568
    {
569
        $this->raLocations->removeWithId($event->raLocationId);
570
    }
571
572
    /**
573
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
574
     * @param InstitutionConfigurationRemovedEvent $event
575
     */
576
    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...
577
    {
578
        // reset all configuration to defaults. This way, should it be rebuild, it seems like it is new again
579
        $this->raLocations                     = new RaLocationList([]);
580
        $this->useRaLocationsOption            = UseRaLocationsOption::getDefault();
581
        $this->showRaaContactInformationOption = ShowRaaContactInformationOption::getDefault();
582
        $this->verifyEmailOption               = VerifyEmailOption::getDefault();
583
        $this->numberOfTokensPerIdentityOption = NumberOfTokensPerIdentityOption::getDefault();
584
        $this->allowedSecondFactorList         = AllowedSecondFactorList::blank();
585
        $this->useRaOption = InstitutionAuthorizationOption::getDefault(InstitutionRole::useRa());
586
        $this->useRaaOption = InstitutionAuthorizationOption::getDefault(InstitutionRole::useRaa());
587
        $this->selectRaaOption = InstitutionAuthorizationOption::getDefault(InstitutionRole::selectRaa());
588
589
        $this->isMarkedAsDestroyed             = true;
590
    }
591
}
592