Commit dfffcca
feat: exclude guest accounts from the employee directory
Guest accounts — users created by the Guests app — are external people invited
to collaborate on files. They have no entitlement and take no leave, but the app
treated every account as staff, so each guest sat in the balances report and the
who's-off calendar forever with an empty allowance and nothing to show.
Four services each walked IUserManager with their own copy of that loop, so a
rule about who is *not* an employee had to be repeated four times to hold — and
would silently not hold wherever it was forgotten. EmployeeDirectory is now the
one place that answers "who are the employees", and ReportService,
EntitlementService, CoverageService and ManagerResolver all ask it.
Detection reads the user backend: a guest lives in the Guests app's own backend,
which is what OCA\Guests\GuestManager::isGuest() checks too. Read that way the
app needs no dependency on the Guests app — where it is absent or disabled no
account has that backend and the rule is simply never true, so instances without
guests are unaffected.
Enforced, not merely hidden. Filtering only the lists would leave the rule one
crafted request away from being bypassed, so the API rejects recording leave for
a guest (including by HR, who may otherwise record for anyone), nominating one as
a replacement, and setting one's entitlement. Guests also cannot be resolved as a
line manager: that is more than tidiness, because a request routed to a guest
approver could never be approved.
The people pickers move off core's autocomplete to a new /api/employees/search,
because only the server can tell a guest from a colleague — a client-side filter
would be no filter at all. It wraps the same collaborator search core uses, so
the admin's user-enumeration settings keep applying exactly as before; guests are
removed from whatever that search returns.
Existing records for someone who later becomes a guest are left untouched in the
database; they simply stop being listed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 58596a3 commit dfffcca
24 files changed
Lines changed: 501 additions & 68 deletions
File tree
- appinfo
- js
- lib
- Controller
- Service
- src
- tests/Unit/Service
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
75 | 110 | | |
76 | 111 | | |
77 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
Lines changed: 14 additions & 14 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments