Feat settings cascade (#3)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #3.
This commit is contained in:
@@ -46,6 +46,10 @@ type RunContext struct {
|
||||
|
||||
// ChannelID is the context identifier, if any.
|
||||
ChannelID string
|
||||
|
||||
// TeamID is the team context for settings cascade resolution (v0.2.0).
|
||||
// When set, team-scoped package settings are included in the cascade.
|
||||
TeamID string
|
||||
}
|
||||
|
||||
// Runner executes Starlark package scripts with permission-gated modules.
|
||||
@@ -337,12 +341,14 @@ func (r *Runner) buildModulesWithLibCtx(ctx context.Context, packageID string, m
|
||||
}
|
||||
|
||||
// v0.30.0: settings module — always injected, no permission required.
|
||||
// A package reads its own admin + user settings.
|
||||
// A package reads its own admin + team + user settings (v0.2.0 cascade).
|
||||
userID := ""
|
||||
teamID := ""
|
||||
if rc != nil {
|
||||
userID = rc.UserID
|
||||
teamID = rc.TeamID
|
||||
}
|
||||
modules["settings"] = BuildSettingsModule(ctx, r.stores, packageID, userID)
|
||||
modules["settings"] = BuildSettingsModule(ctx, r.stores, packageID, userID, teamID)
|
||||
|
||||
// v0.38.2: lib module — always injected, no permission required.
|
||||
// Allows any starlark package to load declared library dependencies.
|
||||
|
||||
Reference in New Issue
Block a user