v.21.4New Features
Add Optional GRANTEES Clause to CREATE/ALTER USER Commands
Add new optional clauseGRANTEESforCREATE/ALTER USERcommands. It specifies users or roles which are allowed to receive grants from this user on condition this user has also all required access granted with grant option. By defaultGRANTEES ANYis used which means a user with grant option can grant to anyone. Syntax:CREATE USER ... GRANTEES {user | role | ANY | NONE} [,...] [EXCEPT {user | role} [,...]]. #21641 (Vitaly Baranov).
Why it matters
This feature allows tighter control over delegation of privileges by specifying exactly which users or roles are authorized to receive grants from a user who has grant options, enhancing security and preventing unauthorized privilege delegation.How to use it
Use theGRANTEES clause within the CREATE USER or ALTER USER statements as follows:CREATE USER ... GRANTEES {user | role | ANY | NONE} [,...] [EXCEPT {user | role} [,...]]By default,
GRANTEES ANY is assumed, allowing the user to grant privileges to anyone. To restrict grantees, specify users or roles explicitly along with optional EXCEPT exclusions.