Repository navigation
Let only an automation's creator change or run it, and only a bot's creator change its setup - #362
Merged
Merged
Conversation
…reator change its setup Every firing runs as the member who created the automation: their keys, spend allowance, sandbox minutes and personal connections. The schedules service now decides who may act on one, for every door: the automations API, a bot's routines and an agent's automation tools. The creator edits, enables and runs it now; an org owner or admin may also pause or delete it, authorized in the organisation's turn so a demotion that lands meanwhile is seen; an automation with no creator stays open to members. Anyone else gets 403 automation_creator_only with a message naming the creator, and the Automations page shows that message. A bot's standing rules steer every turn it takes, its routines' unattended ones included, so a bot's setup (rules, preset, routines) is now its creator's too (botEditableBy): others get 403 bot_owner_only naming the creator and see the rules read-only, an org owner or admin may still archive or restore it, everyone may still message it, and a routine someone else added earlier no longer fires.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every firing of an automation runs as the member who created it: their keys, spend allowance, sandbox minutes and personal connections. So the schedules service now decides who may act on an automation, for every door (the automations API, a bot's routines and an agent's automation tools):
PATCH {"enabled": false}) or delete it, authorized in the organization's turn (asOrgAdmin), so a demotion that lands meanwhile is seen.403 automation_creator_onlywith a message that names the creator; the Automations page shows that message.A bot's standing rules steer every turn it takes, its routines' unattended ones included, so a bot's setup (rules, preset, routines) is its creator's too (
botEditableBy):403 bot_owner_onlynaming the creator, and the details drawer shows them the rules read-only.403 routine_not_bot_owneron run now).Manual firing now goes only through
runScheduleNow, which checks the actor;fireScheduleForOrgis left to the scheduler's cron firings.orgAdminScopeand the new checks share oneisOrgAdmin.Tests:
backend/test/automation-creator.test.tscovers the API, a bot's routines, approved agent tool calls, an admin's pause, delete and archive, a bot's setup, routines added by someone else, and a demotion while a delete waits for the organization's turn. On the frontend, the Automations API client passes the backend's words through (components/automations/schedules-api.test.ts).Need help on this PR? Tag
@codesmith-botwith what you need.