gio.permission
Module for [Permission] class
Types 3
A [gio.permission.Permission] represents the status of the caller’s permission to perform a certain action.
You can query if the action is currently allowed and if it is possible to acquire the permission so that the action will be allowed in the future.
There is also an API to actually acquire the permission and one to release it.
As an example, a [gio.permission.Permission] might represent the ability for the user to write to a [gio.settings.Settings] object. This [gio.permission.Permission] object could then be used to decide if it is appropriate to show a “Click here to unlock” button in a dialog and to provide the mechanism to invoke when that button is clicked.
Methods
Permission self()Returns `this`, for use in `with` statements.PermissionGidBuilder builder()Get builder for [gio.permission.Permission] Returns: New builder objectbool allowed() @propertyGet `allowed` property. Returns: true if the caller currently has permission to perform the action that @permission represents the permission to perform.bool canAcquire() @propertyGet `canAcquire` property. Returns: true if it is generally possible to acquire the permission by calling [gio.permission.Permission.acquire].bool canRelease() @propertyGet `canRelease` property. Returns: true if it is generally possible to release the permission by calling [gio.permission.Permission.release].bool acquire(gio.cancellable.Cancellable cancellable = null)Attempts to acquire the permission represented by permission.void acquireAsync(gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Attempts to acquire the permission represented by permission.bool acquireFinish(gio.async_result.AsyncResult result)Collects the result of attempting to acquire the permission represented by permission.bool getAllowed()Gets the value of the 'allowed' property. This property is true if the caller currently has permission to perform the action that permission represents the permission to perform. Returns: the valu...bool getCanAcquire()Gets the value of the 'can-acquire' property. This property is true if it is generally possible to acquire the permission by calling [gio.permission.Permission.acquire]. Returns: the value of the ...bool getCanRelease()Gets the value of the 'can-release' property. This property is true if it is generally possible to release the permission by calling [gio.permission.Permission.release]. Returns: the value of the ...void implUpdate(bool allowed, bool canAcquire, bool canRelease)This function is called by the #GPermission implementation to update the properties of the permission. You should never call this function except from a #GPermission implementation.bool release(gio.cancellable.Cancellable cancellable = null)Attempts to release the permission represented by permission.void releaseAsync(gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Attempts to release the permission represented by permission.bool releaseFinish(gio.async_result.AsyncResult result)Collects the result of attempting to release the permission represented by permission.Fluent builder for [gio.permission.Permission]
Methods