X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDBUtils.pm;h=6ba89df1f36c7193ba1c48613e63b1ed8f7f8258;hb=e19609317e221f6b10cbe18a70b215d744736388;hp=54cf7da1726e31001d9b0470dce258ad1689174b;hpb=51dd16d697cc3ff688af1a59369833650e9e1fbf;p=kivitendo-erp.git diff --git a/SL/DBUtils.pm b/SL/DBUtils.pm index 54cf7da17..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; @@ -432,7 +439,7 @@ DBUtils provides wrapper functions for low level database retrieval. It saves 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