Replace hardcoded permission strings with per-component constants
Table of Contents
This page is a capture in the next bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
What
(One paragraph: the idea.)
Why
(Motivation, problem being solved, related context.)
References
See also
Handlers currently inline permission strings:
if (!has_permission(req_ctx, "analytics::pricing_engine_types:write")) {
This makes permissions impossible to enumerate, audit, or test without grepping.
Proposed approach:
- Each component gets a
permissions.hppheader (or namespace block in the component header) declaringconstexpr std::string_viewconstants for every action the component exposes. - Handlers reference the constant; the inline string literal disappears.
- A companion unit test verifies that every declared constant appears in the IAM permissions seed data.