Allow to set stocktake date for part lots

This commit is contained in:
Jan Böhmer 2026-02-10 22:23:54 +01:00
parent e5231e29f2
commit 2f9601364e
6 changed files with 53 additions and 25 deletions

View file

@ -58,13 +58,13 @@ final class PartLotVoter extends Voter
{
}
protected const ALLOWED_PERMS = ['read', 'edit', 'create', 'delete', 'show_history', 'revert_element', 'withdraw', 'add', 'move'];
protected const ALLOWED_PERMS = ['read', 'edit', 'create', 'delete', 'show_history', 'revert_element', 'withdraw', 'add', 'move', 'stocktake'];
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token, ?Vote $vote = null): bool
{
$user = $this->helper->resolveUser($token);
if (in_array($attribute, ['withdraw', 'add', 'move'], true))
if (in_array($attribute, ['withdraw', 'add', 'move', 'stocktake'], true))
{
$base_permission = $this->helper->isGranted($token, 'parts_stock', $attribute, $vote);