Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-20.2: sql: do not inherit role options #55305

Merged

Conversation

solongordon
Copy link
Contributor

Backport 1/1 commits from #55292.

/cc @cockroachdb/release


Previously, if a role had a role-level option like CREATEROLE, users who
were granted this role would inherit that privilege. This is
incompatible with Postgres, where such options are not inherited and
must be set explicitly on each user. I changed our behavior to match
Postgres.

The only role option this affects which is present in v20.1 is
CREATEROLE. This also affects all the new role options we added in
v20.2, such as CREATEDB.

Note that this does not affect privileges on database objects, e.g. the
SELECT privilege on a table. These continue to be inherited.

Fixes #53480

Release note (backward-incompatible change): For PostgreSQL
compatibility, the CREATEROLE privilege is no longer inherited by
children of a role which has that privilege. For example, say we run
these statements:

CREATE ROLE parent WITH CREATEROLE;
CREATE ROLE child;
GRANT parent TO child;

Previously, the child role would have the CREATEROLE privilege. Now it
will not. In order to grant this privilege to the child role, it is
necessary to run ALTER ROLE child WITH CREATEROLE.

Previously, if a role had a role-level option like CREATEROLE, users who
were granted this role would inherit that privilege. This is
incompatible with Postgres, where such options are not inherited and
must be set explicitly on each user. I changed our behavior to match
Postgres.

The only role option this affects which is present in v20.1 is
CREATEROLE. This also affects all the new role options we added in
v20.2, such as CREATEDB.

Note that this does not affect privileges on database objects, e.g. the
SELECT privilege on a table. These continue to be inherited.

Fixes cockroachdb#53480

Release note (backward-incompatible change): For PostgreSQL
compatibility, the CREATEROLE privilege is no longer inherited by
children of a role which has that privilege. For example, say we run
these statements:
```
CREATE ROLE parent WITH CREATEROLE;
CREATE ROLE child;
GRANT parent TO child;
```
Previously, the child role would have the CREATEROLE privilege. Now it
will not. In order to grant this privilege to the child role, it is
necessary to run `ALTER ROLE child WITH CREATEROLE`.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@solongordon solongordon requested a review from otan October 7, 2020 19:04
@solongordon solongordon merged commit 4e07f48 into cockroachdb:release-20.2 Oct 7, 2020
@solongordon solongordon deleted the backport20.2-55292 branch October 13, 2020 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants