DATEV-Version auf 5.x anheben
[kivitendo-erp.git] / SL / DBUtils.pm
index 9dfe271..c9c70c9 100644 (file)
@@ -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,7 +436,7 @@ 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: