jhalter / mobius

A Hotline server implemented in Golang for macOS, Linux, and Windows operating systems
MIT License
78 stars 8 forks source link

Improve human readability of account config files #150

Closed jhalter closed 4 months ago

jhalter commented 4 months ago

The account config files in config/Users were not originally intended to be viewed and edited by humans, but in practice it's useful to see and edit permissions outside of a Hotline client.

This change overrides the YAML marshal/unmarshaling to write the account permission bitmap as a human readable map of boolean flags instead of the previously inscrutable array of ints.

Existing user configs in the old format can still be read and will update to the new format on first save.

I also realized the Folder Upload/Download access bits missing and fixed them.

Before

Access: [96, 112, 12, 32, 3, 128, 0, 0]

After

Access:
    DownloadFile: true
    DownloadFolder: true
    UploadFile: true
    UploadFolder: false
    DeleteFile: false
    ...