We have a door access policy system (https://www.dsek.se/admin/doors) that allows you to give roles permission to open doors. Right now, this is just a plain text input. We want to ensure users don't input invalid roles in this field.
Solution
Suggestion: add auto-complete based on the position ids stored in the database.
Note that the set of valid roles is a superset of all position ids. For instance, dsek.infu is a valid role since it's derived from infu-positions (e.g. dsek.infu.dwww) but not a valid position.
Description
We have a door access policy system (https://www.dsek.se/admin/doors) that allows you to give roles permission to open doors. Right now, this is just a plain text input. We want to ensure users don't input invalid roles in this field.
Solution
Suggestion: add auto-complete based on the position ids stored in the database.
Note that the set of valid roles is a superset of all position ids. For instance,
dsek.infu
is a valid role since it's derived from infu-positions (e.g.dsek.infu.dwww
) but not a valid position.