`GtkLockButton` is a widget to obtain and revoke authorizations needed to operate the controls.
![An example GtkLockButton](lock-button.png)
It is typically used in preference dialogs or control panels.
The required authorization is represented by a `GPermission` object. Concrete implementations of `GPermission` may use PolicyKit or some other authorization framework. To obtain a PolicyKit-based `GPermission`, use `polkit_permission_new()`.
If the user is not currently allowed to perform the action, but can obtain the permission, the widget looks like this:
![](lockbutton-locked.png)
and the user can click the button to request the permission. Depending on the platform, this may pop up an authentication dialog or ask the user to authenticate in some other way. Once the user has obtained the permission, the widget changes to this:
![](lockbutton-unlocked.png)
and the permission can be dropped again by clicking the button. If the user is not able to obtain the permission at all, the widget looks like this:
![](lockbutton-sorry.png)
If the user has the permission and cannot drop it, the button is hidden.
The text (and tooltips) that are shown in the various cases can be adjusted with the [[email protected]:text-lock], [ [email protected]:text-unlock], [[email protected]:tooltip-lock], [[email protected]:tooltip-unlock] and [ [email protected]:tooltip-not-authorized] properties.