mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
feat: save DocMDP level from global config to file on creation
- Add DocMdpConfigService dependency to RequestSignatureService - Create setDocMdpLevelFromGlobalConfig() method - Save admin DocMDP configuration to file entity on creation - Allows per-file DocMDP configuration instead of only global Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
parent
3a026f5c10
commit
cff28b6ceb
1 changed files with 10 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ class RequestSignatureService {
|
|||
protected IEventDispatcher $eventDispatcher,
|
||||
protected FileStatusService $fileStatusService,
|
||||
protected SignRequestStatusService $signRequestStatusService,
|
||||
protected DocMdpConfigService $docMdpConfigService,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
@ -128,6 +129,8 @@ class RequestSignatureService {
|
|||
$this->setSignatureFlowFromGlobalConfig($file);
|
||||
}
|
||||
|
||||
$this->setDocMdpLevelFromGlobalConfig($file);
|
||||
|
||||
$this->fileMapper->insert($file);
|
||||
return $file;
|
||||
}
|
||||
|
|
@ -138,6 +141,13 @@ class RequestSignatureService {
|
|||
$file->setSignatureFlowEnum($globalFlow);
|
||||
}
|
||||
|
||||
private function setDocMdpLevelFromGlobalConfig(FileEntity $file): void {
|
||||
if ($this->docMdpConfigService->isEnabled()) {
|
||||
$docmdpLevel = $this->docMdpConfigService->getLevel();
|
||||
$file->setDocmdpLevelEnum($docmdpLevel);
|
||||
}
|
||||
}
|
||||
|
||||
private function getFileMetadata(\OCP\Files\Node $node): array {
|
||||
$metadata = [];
|
||||
if ($extension = strtolower($node->getExtension())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue