Skip to content

Create enum to to authorize common keys

Alexander Lohnau requested to merge work/kiosk_enum into master

By using an enum we have a central place to provide docs for the most common actions/restrictions. Also consumers can pass in type-safe enum values instead of potentially undocumented strings that might contain typos.

Also it is better documents is a value is supposed to be authorized using KAuthorized::authorize or KAuthorized::authorizeAction, in the case of "shell_access" this was mixed up from time to time.

Considering that we do not want the parameter for the methods to become too long I have deliberately decided against using enum class. Also we don't have and usecases for the binary operators in combination with the newly added enums.

Task: https://phabricator.kde.org/T11948

Edited by Alexander Lohnau

Merge request reports