Skip to content

Commit

Permalink
Fix ##8462: Allow a user with the "GRANT_REVOKE_ON_ANY_OBJECT" privil…
Browse files Browse the repository at this point in the history
…ege to revoke permissions that were granted by someone other

(cherry picked from commit b1c1202)
  • Loading branch information
dmitry-starodubov authored and AlexPeshkoff committed Mar 10, 2025
1 parent c9928ad commit 9676433
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dsql/DdlNodes.epp
Original file line number Diff line number Diff line change
Expand Up @@ -11993,11 +11993,11 @@ void GrantRevokeNode::grantRevoke(thread_db* tdbb, jrd_tra* transaction, const G

MetaName owner;
if ((grantorRevoker == PRIV.RDB$GRANTOR) ||
(attachment->locksmith(tdbb, GRANT_REVOKE_ON_ANY_OBJECT) || // God-like check
((objType == obj_sql_role) && (PRIV.RDB$PRIVILEGE[0] == 'M') && // This is ROLE to USER grant
(currentUser != user) && // And current user does not revoke his own grant
((isItSqlRole(tdbb, transaction, objName, owner) && // Pick up role owner name
(attachment->locksmith(tdbb, GRANT_REVOKE_ON_ANY_OBJECT) || // God-like check
(owner == currentUser))) || // Current user is role owner
(isItSqlRole(tdbb, transaction, objName, owner) && // Pick up role owner name
(owner == currentUser)) || // Current user is role owner
(getGrantorOption(tdbb, transaction, currentUser, obj_user, objName) == 2)))) // or has ADMIN option
{
MetaName newField = NULL;
Expand Down

0 comments on commit 9676433

Please sign in to comment.