Skip to content
PR Quorum
Sign inStart free
← Review gallery
Leantime/leantime #3653openreviewed 7h ago

feat(users): weekly_hours + employment_type on user (Slice 1)

by gloriafolaron+570 19 filesreviewed in 46sView PR on GitHub
needs attentionThe panel surfaced issues that deserve attention before merge.2 findings · 1 high+

Reviewer panel

Correctness
deepseek/deepseek-v4-flash
0 found
Security
deepseek/deepseek-v4-flash
1 found
Architecture
deepseek/deepseek-v4-flash
1 found

Findings

01Hhighconf 75%

Server-side authorization missing for capacity field writes

app/Domain/Users/Controllers/EditUser.php:219

The blade template gates the capacity UI section behind Roles::admin, but the controller method that processes the form submission (likely update or a similar method) is not shown in this diff. If the server-side handler does not independently verify the caller has admin privileges before writing weekly_hours or employment_type, any authenticated user could craft a POST request to set these fields on any user (including themselves) via IDOR or direct param tampering. The buildValuesFromPost method in the diff reads these fields directly from $_POST without any ownership or role check. This would allow privilege escalation (setting employment type) and data integrity issues for downstream capacity planning.

02Mmedconf 90%

Tests rely on copied editUser logic via anonymous subclass, creating maintenance drift

tests/Unit/app/Domain/Users/Repositories/UsersRepositoryTest.php

The UsersRepositoryTest creates an anonymous subclass that duplicates the real editUser method's updateData construction logic (lines 174–202). While it bridges to the private normalizers via reflection, the core partial-update guard (array_key_exists logic) is reimplemented rather than exercised through the actual production method. Any future change to editUser (adding a new field, altering normalization order) will not automatically cause these tests to fail, creating a false sense of coverage. Prefer to test via the public interface by mocking the DB connection, or extract the normalization and partial-update logic into testable helpers.

Want this on your own pull requests?
The same reviewer panel runs on every PR — one focused review, no noise.
Start freeLive demo