API begin and end fields for Admins (#5134)
This commit is contained in:
@@ -12,11 +12,18 @@ namespace App\Timesheet\TrackingMode;
|
||||
use App\Entity\Timesheet;
|
||||
use DateTime;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
final class PunchInOutMode implements TrackingModeInterface
|
||||
{
|
||||
use TrackingModeTrait;
|
||||
|
||||
public function __construct(
|
||||
private readonly AuthorizationCheckerInterface $authorizationChecker
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public function canEditBegin(): bool
|
||||
{
|
||||
return false;
|
||||
@@ -34,7 +41,7 @@ final class PunchInOutMode implements TrackingModeInterface
|
||||
|
||||
public function canUpdateTimesWithAPI(): bool
|
||||
{
|
||||
return false;
|
||||
return $this->authorizationChecker->isGranted('view_other_timesheet');
|
||||
}
|
||||
|
||||
public function create(Timesheet $timesheet, ?Request $request = null): void
|
||||
|
||||
Reference in New Issue
Block a user