]> git.evergreen-ils.org Git - Evergreen.git/blob - docs/RELEASE_NOTES_NEXT/Architecture/Block_Login_of_Expired_Staff_Accounts.adoc
LP#1474029: teach Evergreen how to prevent expired staff from logging in
[Evergreen.git] / docs / RELEASE_NOTES_NEXT / Architecture / Block_Login_of_Expired_Staff_Accounts.adoc
1 Block Login of Expired Staff Accounts
2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 Evergreen now has the ability to prevent staff users whose
4 accounts have expired from logging in. This is controlled
5 by the new global flag "auth.block_expired_staff_login", which
6 is not enabled by default. If that flag is turned on, accounts
7 that have the `STAFF_LOGIN` permission and whose expiration date
8 is in the past are prevented from logging into any Evergreen
9 interface, including the staff client, the public catalog, and SIP2.
10
11 It should be noted that ordinary patrons are allowed to log into
12 the public catalog if their circulation privileges have expired. This
13 feature prevents expired staff users from logging into the public catalog
14 (and all other Evergreen interfaces and APIs) outright in order to
15 prevent them from getting into the staff interface anyway by
16 creative use of Evergreen's authentication APIs.
17
18 Evergreen admins are advised to check the expiration status of staff
19 accounts before turning on the global flag, as otherwise it is
20 possible to lock staff users out unexpectedly. The following SQL
21 query will identify expired but otherwise un-deleted users that
22 would be blocked by turning on the flag:
23
24 [source,sql]
25 ----
26 SELECT DISTINCT usrname, expire_date
27 FROM actor.usr au, permission.usr_has_perm_at_all(id, 'STAFF_LOGIN')
28 WHERE active
29 AND NOT deleted
30 AND NOT barred
31 AND expire_date < NOW()
32 ----
33
34 Note that this query can take a long time to run in large databases
35 given the general way that it checks for users that have the
36 `STAFF_LOGIN` permission. Replacing the use of
37 `permission.usr_has_perm_at_all()` with a query on expired users
38 with profiles known to have the `STAFF_LOGIN` permission will
39 be much faster.