implements revoking role from user at repository level
This commit is contained in:
@ -79,6 +79,7 @@ begin
|
||||
raise exception '[403] Revoking role % is forbidden for %.', grantedRoleUuid, currentSubjects();
|
||||
end if;
|
||||
|
||||
--raise exception 'isGranted(%, %)', currentSubjectIds(), grantedByRoleUuid;
|
||||
if NOT isGranted(currentSubjectIds(), grantedByRoleUuid) then
|
||||
raise exception '[403] Revoking role granted by % is forbidden for %.', grantedByRoleUuid, currentSubjects();
|
||||
end if;
|
||||
|
@ -99,8 +99,8 @@ create or replace function deleteRbacGrant()
|
||||
returns trigger
|
||||
language plpgsql as $$
|
||||
begin
|
||||
call revokeRoleFromUser(assumedRoleUuid(), old.grantedRoleUuid, old.userUuid);
|
||||
return null;
|
||||
call revokeRoleFromUser(old.grantedByRoleUuid, old.grantedRoleUuid, old.userUuid);
|
||||
return old;
|
||||
end; $$;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user