Skip to content

Grant and Revoke update (field) [CORE4407] #4729

@firebird-automations

Description

@firebird-automations

Submitted by: Tomas Beran (berant)

I have a problem with permissions. I test this problem on new database.
I have two users (User1 and User2), one table (TEST_TABLE (PKID, NAME, AGE)). I set permission select and update(AGE) to both users. Now everything is all right, but when I revoke permission to USER2 (revoke select, update(AGE)), then USER1 has not permission to update fields (but he should have).

Example:
create table TEST_TABLE ( PKID integer, NAME varchar(10), AGE integer,
constraint TEST_PKID primary key (PKID));

commit;

insert into TEST_TABLE values (1, 'TEST', 99);

grant select, update(AGE) on TEST_TABLE to USER1, USER2;

--USER1 or USER2:
update TEST_TABLE set AGE = 1; --both can update

revoke select, update(AGE) on TEST_TABLE from USER2;
--USER1:
update TEST_TABLE set AGE = 1; --no permission to update

Now USER1 has no permission for update/write access to COLUMN TEST_TABLE.AGE
but has permission to select. If I grant update on whole TEST_TABLE then everything all right, but if I set permission on one field,
permissions are wrong.