This class encapsulates the process of "logging-in" to ENLIGHTEN and enabling or displaying GUI widgets which should only be exposed to certain user classes.
More...
This class encapsulates the process of "logging-in" to ENLIGHTEN and enabling or displaying GUI widgets which should only be exposed to certain user classes.
Currently there are four levels setup:
- BASIC
- default, no authentication required
- user cannot edit ANY of the fields in the EEPROMEditor (display-only)
- user can "save .ini", and edit desired fields directly in that file (only affects their PC, in their Documents directory)
- cannot write EEPROM
- ADVANCED
- password "wasatch" (hardcoded)
- enables "Advanced Users" controls
- some manufacturing tests and experimental features
- excitation spinner on Laser Control Widget
- allows user to edit "safe" fields in the EEPROM editor (see EEPROM.is_editable)
- editted "safe" fields can be saved to .ini
- still cannot write EEPROM
- OEM
- password "wasatchoem" (hardcoded)
- displays "Save EEPROM" button
- EEPROM can be written, but EEPROM.write_eeprom() method will only update "is_editable" fields in the page buffers before writing
- PRODUCTION
- password NOT hardcoded (ask Zieg or production team)
- all EEPROM fields editable
- EEPROM can be written
You'll note we're not too worried about security, hard-coding passwords and hashes and all. The truth is that our full USB API is (deliberately) published for application developers in ENG-0001, and the full EEPROM layout is defined publicly in ENG-0034, so essentially any knowledgable user can do anything anyway. This is more a matter of keeping dangerous / confusing / experimental options on a high shelf so new users don't randomly click buttons just to see what they do.
- Relationship to Advanced Options
They are disconnected and orthogonal (see Advanced Options docs).
| enlighten.ui.Authentication.Authentication._update_auth_widget |
( |
| self, |
|
|
| widget, |
|
|
| auth ) |
|
protected |
If you want a hidden widget to become VISIBLE if the user is logged-in, use the Qt Designer to give the widget a boolean "custom property" called "initiallyVisible" and set it False.
By default, Authentication just determines whether a widget is ENABLED, not VISIBLE (think EEPROMEditor fields). Widgets lacking this custom property will be visible at all times, and only their ENABLED status will change.
(Obviously, in addition to the custom property, you must also add such widgets to the constructor lists passed to this object.)