privetd: Compare user scope with minimalRole for local commands
Prived passes current auth scope corresponding to the current
/privet/v3/commands/execute requests to buffet.
Buffet compare scope with minimalRole of requested command and denies
request if scope is not enough.
BUG=brillo:808
TEST=`FEATURES=test emerge-gizmo buffet privetd`
Change-Id: Ib691184460fcd9d099e0688eaeadf831229672aa
Reviewed-on: https://chromium-review.googlesource.com/274234
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/buffet/manager.h b/buffet/manager.h
index 2acb73e..35e6e25 100644
--- a/buffet/manager.h
+++ b/buffet/manager.h
@@ -77,7 +77,8 @@
const chromeos::VariantDictionary& property_set) override;
bool GetState(chromeos::ErrorPtr* error, std::string* state) override;
void AddCommand(DBusMethodResponse<std::string> response,
- const std::string& json_command) override;
+ const std::string& json_command,
+ const std::string& in_user_role) override;
void GetCommand(DBusMethodResponse<std::string> response,
const std::string& id) override;
void SetCommandVisibility(