It derives from <GObject>.
A <GPermission> 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 <GPermission> might represent
the ability for the user to write to a
<GSettings> object. This
<GPermission> 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.
parent-instance#t if the caller currently has permission to perform the action
that permission represents the permission to perform.
Its value is a boolean.
It is read only.
#t if it is generally possible to acquire the permission by
calling permission:acquire?.
Its value is a boolean.
It is read only.
#t if it is generally possible to release the permission by
calling permission:release?.
Its value is a boolean.
It is read only.
Attempts to acquire the permission represented by self.
This is the first half of the asynchronous version of
permission:acquire?.
Passed: a <GPermission>.
a <GPermission> instance
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable>, or #f
Passed, or left out: a procedure, or #f.
the GAsyncReadyCallback to call when
done
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the user data to pass to callback
Collects the result of attempting to acquire the permission represented by self.
This is the second half of the asynchronous version of
permission:acquire?.
Passed: a <GPermission>.
a <GPermission> instance
Passed: a <GAsyncResult>.
the <GAsyncResult> given to the
GAsyncReadyCallback
Returned: a boolean.
#t if the permission was successfully acquired
Attempts to acquire the permission represented by self.
The precise method by which this happens depends on the permission and the underlying authentication mechanism. A simple example is that a dialog may appear asking the user to enter their password.
You should check with permission:get-can-acquire? before calling this
function.
If the permission is acquired then #t is returned. Otherwise,
#f is returned and error is set appropriately.
This call is blocking, likely for a very long time (in the case that
user interaction is required). See permission:acquire-async for the non-blocking version.
Passed: a <GPermission>.
a <GPermission> instance
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable>, or #f
Returned: a boolean.
#t if the permission was successfully acquired
Gets the value of the ’allowed’ property. This property is #t if
the caller currently has permission to perform the action that
self represents the permission to perform.
Passed: a <GPermission>.
a <GPermission> instance
Returned: a boolean.
the value of the ’allowed’ property
Gets the value of the ’can-acquire’ property. This property is
#t if it is generally possible to acquire the permission by
calling permission:acquire?.
Passed: a <GPermission>.
a <GPermission> instance
Returned: a boolean.
the value of the ’can-acquire’ property
Gets the value of the ’can-release’ property. This property is
#t if it is generally possible to release the permission by
calling permission:release?.
Passed: a <GPermission>.
a <GPermission> instance
Returned: a boolean.
the value of the ’can-release’ property
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.
GObject notify signals are generated, as appropriate.
Passed: a <GPermission>.
a <GPermission> instance
Passed: a boolean.
the new value for the ’allowed’ property
Passed: a boolean.
the new value for the ’can-acquire’ property
Passed: a boolean.
the new value for the ’can-release’ property
Attempts to release the permission represented by self.
This is the first half of the asynchronous version of
permission:release?.
Passed: a <GPermission>.
a <GPermission> instance
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable>, or #f
Passed, or left out: a procedure, or #f.
the GAsyncReadyCallback to call when
done
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the user data to pass to callback
Collects the result of attempting to release the permission represented by self.
This is the second half of the asynchronous version of
permission:release?.
Passed: a <GPermission>.
a <GPermission> instance
Passed: a <GAsyncResult>.
the <GAsyncResult> given to the
GAsyncReadyCallback
Returned: a boolean.
#t if the permission was successfully released
Attempts to release the permission represented by self.
The precise method by which this happens depends on the permission and the underlying authentication mechanism. In most cases the permission will be dropped immediately without further action.
You should check with permission:get-can-release? before calling this
function.
If the permission is released then #t is returned. Otherwise,
#f is returned and error is set appropriately.
This call is blocking, likely for a very long time (in the case that
user interaction is required). See permission:release-async for the non-blocking version.
Passed: a <GPermission>.
a <GPermission> instance
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable>, or #f
Returned: a boolean.
#t if the permission was successfully released
Attempts to acquire the permission represented by self.
The precise method by which this happens depends on the permission and the underlying authentication mechanism. A simple example is that a dialog may appear asking the user to enter their password.
You should check with permission:get-can-acquire? before calling this
function.
If the permission is acquired then #t is returned. Otherwise,
#f is returned and error is set appropriately.
This call is blocking, likely for a very long time (in the case that
user interaction is required). See permission:acquire-async for the non-blocking version.
To override it in a new class, give register-type #:vfuncs
`((acquire . ,procedure)). The procedure is called as
(procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call:
<GPermission>, or a class that derives from it,
or its GType number.
Passed: a <GPermission>.
a <GPermission> instance
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable>, or #f
Returned: a boolean.
#t if the permission was successfully acquired
Attempts to acquire the permission represented by self.
This is the first half of the asynchronous version of
permission:acquire?.
To override it in a new class, give register-type #:vfuncs
`((acquire-async . ,procedure)). The procedure is called as
(procedure self cancellable callback user-data).
Passed: the class whose implementation to call:
<GPermission>, or a class that derives from it,
or its GType number.
Passed: a <GPermission>.
a <GPermission> instance
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable>, or #f
Passed, or left out: a procedure, or #f.
the GAsyncReadyCallback to call when
done
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the user data to pass to callback
Collects the result of attempting to acquire the permission represented by self.
This is the second half of the asynchronous version of
permission:acquire?.
To override it in a new class, give register-type #:vfuncs
`((acquire-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call:
<GPermission>, or a class that derives from it,
or its GType number.
Passed: a <GPermission>.
a <GPermission> instance
Passed: a <GAsyncResult>.
the <GAsyncResult> given to the
GAsyncReadyCallback
Returned: a boolean.
#t if the permission was successfully acquired
Attempts to release the permission represented by self.
The precise method by which this happens depends on the permission and the underlying authentication mechanism. In most cases the permission will be dropped immediately without further action.
You should check with permission:get-can-release? before calling this
function.
If the permission is released then #t is returned. Otherwise,
#f is returned and error is set appropriately.
This call is blocking, likely for a very long time (in the case that
user interaction is required). See permission:release-async for the non-blocking version.
To override it in a new class, give register-type #:vfuncs
`((release . ,procedure)). The procedure is called as
(procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call:
<GPermission>, or a class that derives from it,
or its GType number.
Passed: a <GPermission>.
a <GPermission> instance
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable>, or #f
Returned: a boolean.
#t if the permission was successfully released
Attempts to release the permission represented by self.
This is the first half of the asynchronous version of
permission:release?.
To override it in a new class, give register-type #:vfuncs
`((release-async . ,procedure)). The procedure is called as
(procedure self cancellable callback user-data).
Passed: the class whose implementation to call:
<GPermission>, or a class that derives from it,
or its GType number.
Passed: a <GPermission>.
a <GPermission> instance
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable>, or #f
Passed, or left out: a procedure, or #f.
the GAsyncReadyCallback to call when
done
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the user data to pass to callback
Collects the result of attempting to release the permission represented by self.
This is the second half of the asynchronous version of
permission:release?.
To override it in a new class, give register-type #:vfuncs
`((release-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call:
<GPermission>, or a class that derives from it,
or its GType number.
Passed: a <GPermission>.
a <GPermission> instance
Passed: a <GAsyncResult>.
the <GAsyncResult> given to the
GAsyncReadyCallback
Returned: a boolean.
#t if the permission was successfully released