core: add nm_auth_uid_in_acl()

For checking whether a specific user ID is:
  1) in a known session
  2) allowed by the connection's permissions ACL
This commit is contained in:
Dan Williams
2010-11-18 13:49:47 -06:00
parent eccca738aa
commit 47eaf97d67
2 changed files with 55 additions and 3 deletions

View File

@@ -25,7 +25,9 @@
#include <glib.h>
#include <dbus/dbus-glib.h>
#include <nm-connection.h>
#include "nm-dbus-manager.h"
#include "nm-session-monitor.h"
#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network"
#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake"
@@ -91,5 +93,11 @@ gboolean nm_auth_get_caller_uid (DBusGMethodInvocation *context,
gulong *out_uid,
char **out_error_desc);
/* Caller must free returned error description */
gboolean nm_auth_uid_in_acl (NMConnection *connection,
NMSessionMonitor *smon,
gulong uid,
char **out_error_desc);
#endif /* NM_MANAGER_AUTH_H */