|
26 | 26 | use OCA\Libresign\Helper\FileUploadHelper; |
27 | 27 | use OCA\Libresign\Helper\ValidateHelper; |
28 | 28 | use OCA\Libresign\Service\Crl\CrlService; |
| 29 | +use OCA\Libresign\Service\Policy\PolicyService; |
29 | 30 | use OCA\Libresign\Service\Policy\PolicyAuthorizationService; |
| 31 | +use OCA\Libresign\Service\Policy\Provider\IdentificationDocuments\IdentificationDocumentsPolicy; |
| 32 | +use OCA\Libresign\Service\Policy\Provider\IdentificationDocuments\IdentificationDocumentsPolicyValue; |
30 | 33 | use OCA\Libresign\Service\Policy\RequestSignAuthorizationService; |
31 | 34 | use OCA\Settings\Mailer\NewUserMailHelper; |
32 | 35 | use OCP\Accounts\IAccountManager; |
@@ -76,6 +79,7 @@ public function __construct( |
76 | 79 | private Pkcs12Handler $pkcs12Handler, |
77 | 80 | private IGroupManager $groupManager, |
78 | 81 | private PolicyAuthorizationService $policyAuthorizationService, |
| 82 | + private PolicyService $policyService, |
79 | 83 | private IdDocsService $idDocsService, |
80 | 84 | private SignerElementsService $signerElementsService, |
81 | 85 | private UserElementMapper $userElementMapper, |
@@ -198,8 +202,10 @@ public function getCertificateEngineName(): string { |
198 | 202 | * @return array<string, mixed> |
199 | 203 | */ |
200 | 204 | public function getConfig(?IUser $user = null): array { |
201 | | - |
202 | | - $info['identificationDocumentsFlow'] = $this->appConfig->getValueBool(Application::APP_ID, 'identification_documents', false); |
| 205 | + $resolvedIdentificationDocuments = $user |
| 206 | + ? $this->policyService->resolveForUser(IdentificationDocumentsPolicy::KEY, $user) |
| 207 | + : $this->policyService->resolve(IdentificationDocumentsPolicy::KEY); |
| 208 | + $info['identificationDocumentsFlow'] = IdentificationDocumentsPolicyValue::normalize($resolvedIdentificationDocuments->getEffectiveValue(), false); |
203 | 209 | $info['hasSignatureFile'] = $this->hasSignatureFile($user); |
204 | 210 | $info['phoneNumber'] = $this->getPhoneNumber($user); |
205 | 211 | $info['isApprover'] = $this->validateHelper->userCanApproveValidationDocuments($user, false); |
|
0 commit comments