summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setup.py1
-rw-r--r--webui_templates/distro_edit.tmpl8
-rw-r--r--webui_templates/enoaccess.tmpl10
-rw-r--r--webui_templates/profile_edit.tmpl8
-rw-r--r--webui_templates/repo_edit.tmpl8
-rw-r--r--webui_templates/system_edit.tmpl31
6 files changed, 40 insertions, 26 deletions
diff --git a/setup.py b/setup.py
index 8253216..3285b2f 100644
--- a/setup.py
+++ b/setup.py
@@ -138,6 +138,7 @@ if __name__ == "__main__":
(wwwtmpl, ['webui_templates/empty.tmpl']),
(wwwtmpl, ['webui_templates/blank.tmpl']),
+ (wwwtmpl, ['webui_templates/enoaccess.tmpl']),
(wwwtmpl, ['webui_templates/distro_list.tmpl']),
(wwwtmpl, ['webui_templates/distro_edit.tmpl']),
(wwwtmpl, ['webui_templates/profile_list.tmpl']),
diff --git a/webui_templates/distro_edit.tmpl b/webui_templates/distro_edit.tmpl
index 6089ac9..47b7e10 100644
--- a/webui_templates/distro_edit.tmpl
+++ b/webui_templates/distro_edit.tmpl
@@ -16,10 +16,8 @@ function disablename(value)
#end if
#if $editable != True
-<blockquote>
-WARNING: It looks like you do not have permission to make changes.
-To recieve access, contact your Cobbler server administrator.
-</blockquote>
+#set global $owners = $distro.owners
+#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl"
#end if
<form method="POST" action="$base_url">
@@ -197,7 +195,7 @@ To recieve access, contact your Cobbler server administrator.
</tr>
- #if $distro
+ #if $distro and $editable == True
<tr>
<td>
<label for="delete">Delete</label>
diff --git a/webui_templates/enoaccess.tmpl b/webui_templates/enoaccess.tmpl
new file mode 100644
index 0000000..5af1ae3
--- /dev/null
+++ b/webui_templates/enoaccess.tmpl
@@ -0,0 +1,10 @@
+#set $myowners = ", ".join($owners)
+
+<blockquote>
+WARNING: You do not have permission to make changes to this
+object. To recieve access, contact your Cobbler server administrator.
+</br>
+
+The access control list for this object is: <B><U>$myowners</U></B>.
+</blockquote>
+
diff --git a/webui_templates/profile_edit.tmpl b/webui_templates/profile_edit.tmpl
index a0b6fdc..258a8f2 100644
--- a/webui_templates/profile_edit.tmpl
+++ b/webui_templates/profile_edit.tmpl
@@ -14,10 +14,8 @@ function disablename(value)
#end if
#if $editable != True
-<blockquote>
-WARNING: It looks like you do not have permission to make changes.
-To recieve access, contact your Cobbler server administrator.
-</blockquote>
+#set global $owners = $profile.owners
+#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl"
#end if
<form method="post" action="$base_url?mode=profile_save">
@@ -334,7 +332,7 @@ To recieve access, contact your Cobbler server administrator.
</tr>
- #if $profile
+ #if $profile and $editable == True
<tr>
<td>
<label for="delete">Delete</label>
diff --git a/webui_templates/repo_edit.tmpl b/webui_templates/repo_edit.tmpl
index fdfd840..b58e54f 100644
--- a/webui_templates/repo_edit.tmpl
+++ b/webui_templates/repo_edit.tmpl
@@ -14,10 +14,8 @@ function disablename(value)
#end if
#if $editable != True
-<blockquote>
-WARNING: It looks like you do not have permission to make changes.
-To recieve access, contact your Cobbler server administrator.
-</blockquote>
+#set global $owners = $repo.owners
+#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl"
#end if
<form method="post" action="$base_url?mode=repo_save">
@@ -188,7 +186,7 @@ To recieve access, contact your Cobbler server administrator.
</tr>
- #if $repo
+ #if $repo and $editable == True
<tr>
<td>
<label for="delete">Delete</label>
diff --git a/webui_templates/system_edit.tmpl b/webui_templates/system_edit.tmpl
index 517f569..cdb1adc 100644
--- a/webui_templates/system_edit.tmpl
+++ b/webui_templates/system_edit.tmpl
@@ -14,9 +14,11 @@
function delete_interface(num)
{
- #for $field in $fields
- document.getElementById("${field}-intf" + num).value = "";
- #end for
+ #if $editable == True
+ #for $field in $fields
+ document.getElementById("${field}-intf" + num).value = "";
+ #end for
+ #end if
toggleRowVisibility("id" + num);
}
@@ -87,10 +89,8 @@ function page_onload() {
</script>
#if $editable != True
-<blockquote>
-WARNING: It looks like you do not have permission to make changes.
-To recieve access, contact your Cobbler server administrator.
-</blockquote>
+#set global $owners = $system.owners
+#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl"
#end if
<form method="post" action="$base_url?mode=system_save">
@@ -390,11 +390,20 @@ To recieve access, contact your Cobbler server administrator.
#if $interface != "intf0"
<tr class="listrow" id="child-id${counter}-8">
<td>
- <label for="enabled-$interface">Remove</label>
+ #if $editable == True
+ <label for="enabled-$interface">Remove</label>
+ #else
+ <label for="enabled-$interface">Hide</label>
+ #end if
</td>
<td>
- <input type="button" name="delete-$interface" value="remove" onclick="delete_interface($counter)">
- <p class="context-tip">Clicking this button removes the interface from the configuration.</p>
+ #if $editable == True
+ <input type="button" name="delete-$interface" value="remove" onclick="delete_interface($counter)">
+ <p class="context-tip">Clicking this button removes the interface from the configuration.</p>
+ #else
+ <input type="button" name="delete-$interface" value="hide" onclick="delete_interface($counter)">
+
+ #end if
</td>
</tr>
#end if
@@ -416,7 +425,7 @@ To recieve access, contact your Cobbler server administrator.
</td>
</tr>
- #if $system
+ #if $system and $editable == True
<tr id="id10001">
<td>
<label for="delete">Delete</label>