This allows to query for whether the user may logout from QML-only parts like the desktop toolbox.
Details
Also use KAuthorized::authorize for the other like it's in the docs! The porting was really messed up; will put that in a separate commit also.
Also, according to ksmserver code, "logout" restriction affects also shutdown/reboot which as of now is not enforced in Kickoff, only really logout is disabled.
Diff Detail
- Repository
- R120 Plasma Workspace
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
+1 given the rest are there.
but this doesn't help with the toolbox fixing.
the "Leave" option in that menu isn't the same as logout.
What else should it be? Leave has logout, reboot, shutdown, all of which are options to quit the session which the user is forbidden in this case. It makes no sense to disallow logging out but then allowing turning off the computer altogether.
Leave calls whatever you have selected in systemsettings -> startup and shutdown -> default leave option
AFAIK this setting isn't exposed to the toolbox.
you can argue that if you can't logout you shouldn't be able to shutdown, but that's not how we do the other settings
also you can argue that if you block shutdown, allow logout then set the default shutdown option to shutdown, you're being a bit weird
but I think we should try and do things technically correct to cover the obscure edge cases.
AFAIK this setting isn't exposed to the toolbox.
The toolbox calls "requestShutdown" on the PM dataengine which ends up calling KWorkspace::requestShutdown which does whatever is configured to happen then (show dialog, shutdown immediately etc)
The only place I see KSMServer enforcing a restriction is on the global shortcuts, ie. Log Out, Log Out Without Confirmation, Halt (lol) Without Confirmation, Reboot Without Confirmation are not added if you disable "logout".
The context menu whose actions the toolbox is supposed to mirror also hides the Leave option if you disable "logout".