<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks Aline, I think there might be
some issues by changing the xml file manually. From the <b>tabs.xml</b>
we get the mode that a user should have but it doesn't change when
we change user. I have applied your code and it's something like
this:<br>
<img alt="" src="cid:part1.04050508.04090002@linux.vnet.ibm.com"
height="107" width="1031"><br>
<img alt="" src="cid:part2.08070102.08050504@linux.vnet.ibm.com"
height="109" width="1028"><br>
<br>
Either using a guest or root we can only get the permitted tabs of
the guest. Can we have the kimchi/config/ui/tabs.xml changed
automatically according to the logged in user. Role distinguishing
can be done in the back-end and add the right mode to this xml
file automatically? Or else we might need to find other ways to
transfer the user roles.<br>
<br>
Best regards<br>
Wang Wen<br>
<br>
On 7/11/2014 10:16 AM, <a class="moz-txt-link-abbreviated" href="mailto:alinefm@linux.vnet.ibm.com">alinefm@linux.vnet.ibm.com</a> wrote:<br>
</div>
<blockquote
cite="mid:1405045017-13536-3-git-send-email-alinefm@linux.vnet.ibm.com"
type="cite">
<pre wrap="">From: Aline Manera <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@linux.vnet.ibm.com"><alinefm@linux.vnet.ibm.com></a>
Kimchi has 2 user roles: "admin" with full control of Kimchi features
and "user" with limited access
To describe how each tab should be displayed for a user, the "mode"
attribute should be added.
The "mode" attribute values are:
- none: do not show the tab;
- admin: full instance access;
- read-only: read-only access;
- byInstance: each resource will have its configuration sent by the
backend;
The user will only be able to manage the guests he/she is assigned for,
because that the guest tab has 'mode' == admin
As a user can edit a guest, he/she may need to know which networks
and storage pools are configured, so set network and storage tab 'mode'
to read-only.
And as user should not perform any operation on host or templates, set
their 'mode' attributes to 'none'.
Signed-off-by: Aline Manera <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@linux.vnet.ibm.com"><alinefm@linux.vnet.ibm.com></a>
---
config/ui/tabs.xml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/config/ui/tabs.xml b/config/ui/tabs.xml
index b045521..b8e7bd6 100644
--- a/config/ui/tabs.xml
+++ b/config/ui/tabs.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<tabs>
- <tab>
+ <tab mode="none">
<title>Host</title>
<path>tabs/host.html</path>
</tab>
- <tab>
+ <tab mode="admin">
<title>Guests</title>
<path>tabs/guests.html</path>
</tab>
- <tab>
+ <tab mode="none">
<title>Templates</title>
<path>tabs/templates.html</path>
</tab>
- <tab>
+ <tab mode="read-only">
<title>Storage</title>
<path>tabs/storage.html</path>
</tab>
- <tab>
+ <tab mode="read-only">
<title>Network</title>
<path>tabs/network.html</path>
</tab>
</pre>
</blockquote>
<br>
</body>
</html>