PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Mon Nov 19 22:00:49 PST 2007


 src/polkit/polkit-authorization.c |   17 +++++++++++++++++
 src/polkit/polkit-authorization.h |   18 ++++++++++++++++++
 2 files changed, 35 insertions(+)

New commits:
commit 7c5fa7ddf786986c3d854a9ac1a9dc813b2d33fb
Author: David Zeuthen <davidz at redhat.com>
Date:   Tue Nov 20 01:00:33 2007 -0500

    make PolKitAuthorization a bit more future proof by adding get_type()

diff --git a/src/polkit/polkit-authorization.c b/src/polkit/polkit-authorization.c
index cf11342..5163dd4 100644
--- a/src/polkit/polkit-authorization.c
+++ b/src/polkit/polkit-authorization.c
@@ -95,6 +95,23 @@ _polkit_authorization_get_authfile_entry (PolKitAuthorization *auth)
         return auth->entry_in_auth_file;
 }
 
+
+/**
+ * polkit_authorization_get_type:
+ * @auth: the authorization object
+ *
+ * Determine the type of authorization.
+ *
+ * Returns: the authorization type 
+ *
+ * Since: 0.7
+ */
+PolKitAuthorizationType 
+polkit_authorization_get_type (PolKitAuthorization *auth)
+{
+        return POLKIT_AUTHORIZATION_TYPE_UID;
+}
+
 #ifdef POLKIT_AUTHDB_DEFAULT
 
 PolKitAuthorization *
diff --git a/src/polkit/polkit-authorization.h b/src/polkit/polkit-authorization.h
index 96841bf..b50c036 100644
--- a/src/polkit/polkit-authorization.h
+++ b/src/polkit/polkit-authorization.h
@@ -61,6 +61,8 @@ polkit_bool_t        polkit_authorization_validate       (PolKitAuthorization *a
  *
  * The scope of an authorization; e.g. whether it's limited to a
  * process, a session or unlimited.
+ *
+ * Since: 0.7
  */
 typedef enum {
         POLKIT_AUTHORIZATION_SCOPE_PROCESS_ONE_SHOT,
@@ -69,6 +71,22 @@ typedef enum {
         POLKIT_AUTHORIZATION_SCOPE_ALWAYS,
 } PolKitAuthorizationScope;
 
+/**
+ * PolKitAuthorizationType:
+ * @POLKIT_AUTHORIZATION_TYPE_UID: The authorization is for a UNIX user
+ *
+ * The type of authorization; e.g. whether it applies to a user,
+ * group, security context and so on (right now only users are
+ * supported).
+ *
+ * Since: 0.7
+ */
+typedef enum {
+        POLKIT_AUTHORIZATION_TYPE_UID,
+} PolKitAuthorizationType;
+
+PolKitAuthorizationType polkit_authorization_get_type (PolKitAuthorization *auth);
+
 const char *polkit_authorization_get_action_id (PolKitAuthorization *auth);
 
 uid_t polkit_authorization_get_uid (PolKitAuthorization *auth);


More information about the hal-commit mailing list