[Kimchi-devel] [PATCH 2/2] authorization: Add "mode" attribute to describe user view

alinefm at linux.vnet.ibm.com alinefm at linux.vnet.ibm.com
Fri Jul 11 02:16:57 UTC 2014


From: Aline Manera <alinefm at linux.vnet.ibm.com>

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 <alinefm at linux.vnet.ibm.com>
---
 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>
-- 
1.9.3




More information about the Kimchi-devel mailing list