Skip to content

Commit b1c1202

Browse files
dmitry-starodubovdyemanov
authored andcommitted
Fix ##8462: Allow a user with the "GRANT_REVOKE_ON_ANY_OBJECT" privilege to revoke permissions that were granted by someone other
1 parent a6fa2a5 commit b1c1202

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dsql/DdlNodes.epp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12006,11 +12006,11 @@ void GrantRevokeNode::grantRevoke(thread_db* tdbb, jrd_tra* transaction, const G
1200612006

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

0 commit comments

Comments
 (0)