Skip to content

Commit 9676433

Browse files
dmitry-starodubovAlexPeshkoff
authored andcommitted
Fix ##8462: Allow a user with the "GRANT_REVOKE_ON_ANY_OBJECT" privilege to revoke permissions that were granted by someone other
(cherry picked from commit b1c1202)
1 parent c9928ad commit 9676433

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
@@ -11993,11 +11993,11 @@ void GrantRevokeNode::grantRevoke(thread_db* tdbb, jrd_tra* transaction, const G
1199311993

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

0 commit comments

Comments
 (0)