authorizer

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package authorizer deals client authorization based on a definite set of polkit actions. The client UID and PID are obtained via the D-Bus sender passed to the authorizing method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer struct {
	// contains filtered or unexported fields
}

Authorizer is an abstraction of polkit authorization and D-Bus credential lookup.

func New

func New(bus *dbus.Conn, args ...option) *Authorizer

New returns a new authorizer.

func (Authorizer) CheckSenderAllowed

func (a Authorizer) CheckSenderAllowed(action string, sender dbus.Sender) (err error)

CheckSenderAllowed returns nil if the user is allowed to perform a given operation. Based on the D-Bus sender it will query the user's credentials and then attempt to authorize the action using polkit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL