X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/611491d9d96eb989d1455f87685e57bcaa8f7837..ea4256d880b35648ed0cf5725e43cddf2b8b7b4f:/SL/DBUtils.pm diff --git a/SL/DBUtils.pm b/SL/DBUtils.pm index 9dfe27153..6ba89df1f 100644 --- a/SL/DBUtils.pm +++ b/SL/DBUtils.pm @@ -392,6 +392,13 @@ sub like { return "%" . SL::Util::trim($string // '') . "%"; } +sub role_is_superuser { + my ($dbh, $login) = @_; + my ($is_superuser) = $dbh->selectrow_array(qq|SELECT usesuper FROM pg_user WHERE usename = ?|, undef, $login); + + return $is_superuser; +} + 1; @@ -429,10 +436,10 @@ SL::DBUTils.pm: All about database connections in kivitendo =head1 DESCRIPTION DBUtils provides wrapper functions for low level database retrieval. It saves -you the trouble of mucking around with statement handles for small databse +you the trouble of mucking around with statement handles for small database queries and does exception handling in the common cases for you. -Query and retrieval function share the parameter scheme: +Query and retrieval functions share the parameter scheme: query_or_retrieval(C