Remove the revocation of all function executions

I need to execute some functions in public for citext, such as
texticregexeq, or guest users would not be able to login.
This commit is contained in:
jordi fita mas 2023-01-17 13:05:58 +01:00
parent 989cdd7da7
commit 45439c8559
5 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,8 @@ language plpgsql;
comment on function encrypt_password() is
'Encrypts and salts the input password with the blowfish encryption algorithm';
revoke execute on function encrypt_password() from public;
create trigger encrypt_password
before insert or update
on "user"

View File

@ -20,6 +20,8 @@ language plpgsql;
comment on function ensure_role_exists() is
'Makes sure that a role given to a user is a valid, existing role in the cluster.';
revoke execute on function ensure_role_exists() from public;
create trigger ensure_role_exists
after insert or update
on "user"

View File

@ -21,4 +21,6 @@ stable;
comment on function find_user_role(email, text) is
'Return the database role assigned to the user with the given email and password';
revoke execute on function find_user_role(email, text) from public;
commit;

View File

@ -28,6 +28,7 @@ security definer;
comment on function login(email, text) is
'Checks that the email and password pair is valid and returns the users databasse role.';
revoke execute on function login(email, text) from public;
grant execute on function login(email, text) to guest;
commit;

View File

@ -6,8 +6,6 @@ begin;
revoke create on schema public from public;
revoke usage on schema public from public;
alter default privileges revoke execute on functions from public;
grant usage on schema public to guest;
grant usage on schema public to invoicer;
grant usage on schema public to admin;