mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-04-15 02:19:31 +00:00
Add StoredObjectEditorDecisionManager with tests and interface for editability decisions
- Implemented `StoredObjectEditorDecisionManager` to assess editability of stored objects based on lock status and methods. - Created `StoredObjectEditorDecisionManagerInterface` to define the contract for decision logic. - Added comprehensive test suite `StoredObjectEditorDecisionManagerTest` to validate scenarios including lock absence, conflicting lock methods, and compatible WOPI locks.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\DocStoreBundle\Service\Lock;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\DocStoreBundle\Entity\StoredObjectLockMethodEnum;
|
||||
|
||||
/**
|
||||
* Responsible for managing decisions related to editing stored objects based on their lock status and lock methods.
|
||||
*
|
||||
* This class focuses solely on determining editability concerning existing locks on the stored object.
|
||||
* It does not evaluate permissions.
|
||||
*/
|
||||
interface StoredObjectEditorDecisionManagerInterface
|
||||
{
|
||||
/**
|
||||
* Determines if a stored object can be edited based on its lock status and the lock method.
|
||||
*
|
||||
* This method does not take into account the permissions to edit the stored object. Its purpose is to
|
||||
* check that a future edition (and lock) will be allowed.
|
||||
*
|
||||
* @param StoredObject $storedObject the stored object to check for edit permissions
|
||||
* @param StoredObjectLockMethodEnum $lockMethodEnum the lock method to verify against the stored object's lock
|
||||
*
|
||||
* @return bool returns true if the stored object can be edited, false otherwise
|
||||
*/
|
||||
public function canEdit(StoredObject $storedObject, StoredObjectLockMethodEnum $lockMethodEnum): bool;
|
||||
}
|
||||
Reference in New Issue
Block a user