diff --git a/web/pgadmin/browser/server_groups/servers/templates/macros/default_privilege.macros b/web/pgadmin/browser/server_groups/servers/templates/macros/default_privilege.macros
new file mode 100644
index 0000000..81fb07d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/templates/macros/default_privilege.macros
@@ -0,0 +1,14 @@
+{% macro APPLY(conn, type, role, priv, with_grant) -%}
+{% if priv %}
+ALTER DEFAULT PRIVILEGES
+GRANT {{ priv }} ON {{ type }} TO {{ self.conn|qtIdent(role) }};
+{% endif %}
+{% if with_grant %}
+ALTER DEFAULT PRIVILEGES
+GRANT {{ with_grant }} ON {{ type }} TO {{ self.conn|qtIdent(role) }} WITH GRANT OPTION;
+{% endif %}
+{%- endmacro %}
+{% macro RESETALL(conn, type, role) -%}
+ALTER DEFAULT PRIVILEGES
+    REVOKE ALL ON {{ type }} FROM {{ self.conn|qtIdent(role) }};
+{%- endmacro %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/templates/macros/privilege.macros b/web/pgadmin/browser/server_groups/servers/templates/macros/privilege.macros
new file mode 100644
index 0000000..08d53a4
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/templates/macros/privilege.macros
@@ -0,0 +1,11 @@
+{% macro APPLY(conn, type, role, param, priv, with_grant) -%}
+{% if priv %}
+GRANT {{ priv }} ON {{ type }} {{ self.conn|qtIdent(param) }} TO {{ self.conn|qtIdent(role) }};
+{% endif %}
+{% if with_grant %}
+GRANT {{ with_grant }} ON {{ type }} {{ self.conn|qtIdent(param) }} TO {{ self.conn|qtIdent(role) }} WITH GRANT OPTION;
+{% endif %}
+{%- endmacro %}
+{% macro RESETALL(conn, type, role, param) -%}
+REVOKE ALL ON {{ type }} {{ self.conn|qtIdent(param) }} FROM {{ self.conn|qtIdent(role) }};
+{%- endmacro %}
\ No newline at end of file
