[−][src]Struct zbus_polkit::policykit1::AuthorityProxy
This D-Bus interface is implemented by the /org/freedesktop/PolicyKit1/Authority object on the well-known name org.freedesktop.PolicyKit1 on the system message bus.
Implementations
impl<'c> AuthorityProxy<'c>
[src]
pub fn new(conn: &Connection) -> Result<Self>
[src]
Creates a new proxy with the default service & path.
pub fn new_for(
conn: &Connection,
destination: &'c str,
path: &'c str
) -> Result<Self>
[src]
conn: &Connection,
destination: &'c str,
path: &'c str
) -> Result<Self>
Creates a new proxy for the given destination
and path
.
pub fn new_for_owned(
conn: Connection,
destination: String,
path: String
) -> Result<Self>
[src]
conn: Connection,
destination: String,
path: String
) -> Result<Self>
Same as new_for
but takes ownership of the passed arguments.
pub fn into_inner(self) -> Proxy<'c>
[src]
Consumes self
, returning the underlying zbus::Proxy
.
pub fn inner(&self) -> &Proxy<'_>
[src]
The reference to the underlying zbus::Proxy
.
pub fn authentication_agent_response(
&self,
cookie: &str,
identity: &Identity<'_>
) -> Result<()>
[src]
&self,
cookie: &str,
identity: &Identity<'_>
) -> Result<()>
Method for authentication agents to invoke on successful authentication, intended only for
use by a privileged helper process internal to polkit. This method will fail unless a
sufficiently privileged +caller invokes it. Deprecated in favor of
AuthenticationAgentResponse2()
.
pub fn authentication_agent_response2(
&self,
uid: u32,
cookie: &str,
identity: &Identity<'_>
) -> Result<()>
[src]
&self,
uid: u32,
cookie: &str,
identity: &Identity<'_>
) -> Result<()>
Method for authentication agents to invoke on successful authentication, intended only for
use by a privileged helper process internal to polkit. This method will fail unless a
sufficiently privileged caller invokes it. Note this method was introduced in 0.114 and
should be preferred over AuthenticationAgentResponse()
as it fixes a security issue.
pub fn cancel_check_authorization(&self, cancellation_id: &str) -> Result<()>
[src]
Cancels an authorization check.
Arguments
cancellation_id
- The cancellation_id passed toCheckAuthorization()
.
pub fn check_authorization(
&self,
subject: &Subject,
action_id: &str,
details: HashMap<&str, &str>,
flags: BitFlags<CheckAuthorizationFlags>,
cancellation_id: &str
) -> Result<AuthorizationResult>
[src]
&self,
subject: &Subject,
action_id: &str,
details: HashMap<&str, &str>,
flags: BitFlags<CheckAuthorizationFlags>,
cancellation_id: &str
) -> Result<AuthorizationResult>
Checks if subject is authorized to perform the action with identifier action_id
If cancellation_id
is non-empty and already in use for the caller, the
org.freedesktop.PolicyKit1.Error.CancellationIdNotUnique
error is returned.
Note that CheckAuthorizationFlags::AllowUserInteraction
SHOULD be passed ONLY if the event
that triggered the authorization check is stemming from an user action, e.g. the user
pressing a button or attaching a device.
Arguments
-
subject
- A Subject struct. -
action_id
- Identifier for the action that subject is attempting to do. -
details
- Details describing the action. Keys starting withpolkit.
can only be set if defined in this document.
Known keys include polkit.message
and polkit.gettext_domain
that can be used to override
the message shown to the user. This latter is needed because the user could be running an
authentication agent in another locale than the calling process.
The (translated version of) polkit.message
may include references to other keys that are
expanded with their respective values. For example if the key device_file
has the value
/dev/sda
then the message "Authenticate to format $(device_file)" is expanded to
"Authenticate to format /dev/sda".
The key polkit.icon_name
is used to override the icon shown in the authentication dialog.
If non-empty, then the request will fail with org.freedesktop.PolicyKit1.Error.Failed
unless the process doing the check itsef is sufficiently authorized (e.g. running as uid 0).
-
flags
- A set ofCheckAuthorizationFlags
. -
cancellation_id
- A unique id used to cancel the the authentication check viaCancelCheckAuthorization()
or the empty string if cancellation is not needed.
Returns: An AuthorizationResult
structure.
pub fn enumerate_actions(&self, locale: &str) -> Result<Vec<ActionDescription>>
[src]
Enumerates all registered PolicyKit actions.
Arguments:
locale
- The locale to get descriptions in or the blank string to use the system locale.
pub fn enumerate_temporary_authorizations(
&self,
subject: &Subject
) -> Result<Vec<TemporaryAuthorization>>
[src]
&self,
subject: &Subject
) -> Result<Vec<TemporaryAuthorization>>
Retrieves all temporary authorizations that applies to subject.
pub fn register_authentication_agent(
&self,
subject: &Subject,
locale: &str,
object_path: &str
) -> Result<()>
[src]
&self,
subject: &Subject,
locale: &str,
object_path: &str
) -> Result<()>
Register an authentication agent.
Note that this should be called by same effective UID which will be passed to
AuthenticationAgentResponse2()
.
Arguments
-
subject
- The subject to register the authentication agent for, typically a session subject. -
locale
- The locale of the authentication agent. -
object_path
- The object path of authentication agent object on the unique name of the caller.
pub fn register_authentication_agent_with_options(
&self,
subject: &Subject,
locale: &str,
object_path: &str,
options: HashMap<&str, Value<'_>>
) -> Result<()>
[src]
&self,
subject: &Subject,
locale: &str,
object_path: &str,
options: HashMap<&str, Value<'_>>
) -> Result<()>
Like RegisterAuthenticationAgent
but takes additional options. If the option fallback (of
type Boolean) is TRUE, then the authentcation agent will only be used as a fallback, e.g. if
another agent (without the fallback option set TRUE) is available, it will be used instead.
pub fn revoke_temporary_authorization_by_id(&self, id: &str) -> Result<()>
[src]
Revokes all temporary authorizations that applies to id
.
pub fn revoke_temporary_authorizations(&self, subject: &Subject) -> Result<()>
[src]
Revokes all temporary authorizations that applies to subject
.
pub fn unregister_authentication_agent(
&self,
subject: &Subject,
object_path: &str
) -> Result<()>
[src]
&self,
subject: &Subject,
object_path: &str
) -> Result<()>
Unregister an authentication agent.
Arguments
-
subject
- The subject passed toRegisterAuthenticationAgent()
. -
object_path
- The object_path passed toRegisterAuthenticationAgent()
.
pub fn backend_features(&self) -> Result<AuthorityFeatures>
[src]
This signal is emitted when actions and/or authorizations change The features supported by the currently used Authority backend.
pub fn backend_name(&self) -> Result<String>
[src]
The name of the currently used Authority backend.
pub fn backend_version(&self) -> Result<String>
[src]
The version of the currently used Authority backend.
pub fn introspect(&self) -> Result<String>
[src]
Trait Implementations
impl<'c> Deref for AuthorityProxy<'c>
[src]
Auto Trait Implementations
impl<'c> !RefUnwindSafe for AuthorityProxy<'c>
impl<'c> !Send for AuthorityProxy<'c>
impl<'c> !Sync for AuthorityProxy<'c>
impl<'c> Unpin for AuthorityProxy<'c>
impl<'c> !UnwindSafe for AuthorityProxy<'c>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,