bus-polkit: add a generic vtable for methods with no params, but with polkit
This commit is contained in:
@@ -886,3 +886,8 @@ bool varlink_has_polkit_action(sd_varlink *link, const char *action, const char
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
const sd_json_dispatch_field dispatch_table_polkit_only[] = {
|
||||
VARLINK_DISPATCH_POLKIT_FIELD,
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -35,6 +35,10 @@ static inline int varlink_verify_polkit_async(sd_varlink *link, sd_bus *bus, con
|
||||
.type = SD_JSON_VARIANT_BOOLEAN, \
|
||||
}
|
||||
|
||||
/* A dispatch table that only accepts (but ignores) the Polkit field, and refuses everything else. This can
|
||||
* be used wherever methods do not accept any parameters but shall be access controlled via Polkit. */
|
||||
extern const sd_json_dispatch_field dispatch_table_polkit_only[];
|
||||
|
||||
/* Generates the right Varlink introspection field for the allowInteractiveAuthentication field above. To be used in Varlink IDL definitions. */
|
||||
#define VARLINK_DEFINE_POLKIT_INPUT \
|
||||
SD_VARLINK_FIELD_COMMENT("Controls whether interactive authentication (via polkit) shall be allowed. If unspecified defaults to false."), \
|
||||
|
||||
Reference in New Issue
Block a user