Commit dccf2be2 authored by David Zeuthen's avatar David Zeuthen
Browse files

let authdb backends synthesize policy file entries

parent f0962520
......@@ -67,6 +67,20 @@ _polkit_authorization_db_new (void)
return authdb;
}
void
_polkit_authorization_db_pfe_foreach (PolKitPolicyCache *policy_cache,
PolKitPolicyCacheForeachFunc callback,
void *user_data)
{
}
PolKitPolicyFileEntry*
_polkit_authorization_db_pfe_get_by_id (PolKitPolicyCache *policy_cache,
const char *action_id)
{
return NULL;
}
PolKitAuthorizationDB *
polkit_authorization_db_ref (PolKitAuthorizationDB *authdb)
{
......
......@@ -118,6 +118,21 @@ _polkit_authorization_db_new (void)
return authdb;
}
void
_polkit_authorization_db_pfe_foreach (PolKitPolicyCache *policy_cache,
PolKitPolicyCacheForeachFunc callback,
void *user_data)
{
}
PolKitPolicyFileEntry*
_polkit_authorization_db_pfe_get_by_id (PolKitPolicyCache *policy_cache,
const char *action_id)
{
return NULL;
}
/**
* polkit_authorization_db_ref:
* @authdb: the object
......
......@@ -235,7 +235,10 @@ polkit_policy_cache_get_entry_by_id (PolKitPolicyCache *policy_cache, const char
}
}
pfe = NULL;
if (pfe == NULL) {
/* the authdb backend may want to synthesize pfe's */
pfe = _polkit_authorization_db_pfe_get_by_id (policy_cache, action_id);
}
out:
return pfe;
......@@ -272,6 +275,7 @@ polkit_policy_cache_get_entry (PolKitPolicyCache *policy_cache,
goto out;
pfe = polkit_policy_cache_get_entry_by_id (policy_cache, action_id);
out:
return pfe;
}
......@@ -299,6 +303,11 @@ polkit_policy_cache_foreach (PolKitPolicyCache *policy_cache,
pfe = i->data;
callback (policy_cache, pfe, user_data);
}
/* the authdb backend may also want to return synthesized pfe's */
_polkit_authorization_db_pfe_foreach (policy_cache,
callback,
user_data);
}
/**
......
......@@ -52,6 +52,14 @@ const char *_polkit_authorization_get_authfile_entry (PolKitAuthorization *auth)
PolKitAuthorizationDB *_polkit_authorization_db_new (void);
void _polkit_authorization_db_invalidate_cache (PolKitAuthorizationDB *authdb);
void _polkit_authorization_db_pfe_foreach (PolKitPolicyCache *policy_cache,
PolKitPolicyCacheForeachFunc callback,
void *user_data);
PolKitPolicyFileEntry* _polkit_authorization_db_pfe_get_by_id (PolKitPolicyCache *policy_cache,
const char *action_id);
PolKitPolicyCache *_polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error);
PolKitPolicyCache *_polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment