backupccl: drop admin only check for CREATE SCHEDULE
#87188
Merged
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.
In #86495 we introduced a
BACKUP
privilege that governswhat targets a user is able to backup.
CREATE SCHEDULE FOR BACKUP
under the hood is responsible for running backup statements
at fixed intervals and so it makes sense for the same privilege
checks that apply to the backup statement that will be run to
also apply to
CREATE SCHEDULE
. We get this for free becauseCREATE SCHEDULE
runs a dry-run backup when the schedule is beingcreated, that has all the relevant privilege checks. So similar to
the new backup privilege model:
Cluster backups - require admin or system privilege BACKUP
DB backups - require datbase privilege BACKUP
Table backups - require table privilege BACKUP
Note, in 22.2 since we are continuining to support the old
privilege model the following privilege will also permit a user to
CREATE SCHEDULE
albeit with a deprecation notice warning usersthat this model will be unsupported in a future release:
Cluster backups - require admin
DB backups - users must have CONNECT on the database,
SELECT on every table in the db, and USAGE on every schema, and
type in the db
Table backups - users must have SELECT on the table, and
USAGE on every schema, and type referenced by the table
Release note (sql change): CREATE SCHEDULE is no longer an
admin only operation. Users should grant the appropriate BACKUP
privileges on the targets they wish to back up as part of the schedule.
Cluster backups - require admin or system privilege BACKUP
DB backups - require datbase privilege BACKUP
Table backups - require table privilege BACKUP
Release justification: high impact change for fine grained permission control