Merge branch 'master' of ssh://git.planet-lab.org/git/plstackapi
diff --git a/planetstack/core/static/img/minus_circle.png b/planetstack/core/static/img/minus_circle.png
new file mode 100644
index 0000000..e0cd5a8
--- /dev/null
+++ b/planetstack/core/static/img/minus_circle.png
Binary files differ
diff --git a/planetstack/core/static/img/plus_circle.png b/planetstack/core/static/img/plus_circle.png
new file mode 100644
index 0000000..49746a1
--- /dev/null
+++ b/planetstack/core/static/img/plus_circle.png
Binary files differ
diff --git a/planetstack/core/xoslib/methods/tenantview.py b/planetstack/core/xoslib/methods/tenantview.py
index b2e0e0e..3fa98f6 100644
--- a/planetstack/core/xoslib/methods/tenantview.py
+++ b/planetstack/core/xoslib/methods/tenantview.py
@@ -50,6 +50,10 @@
     for auser in user.site.users.all():
         site_users.append(auser)
 
+    user_site_roles=[]
+    for priv in user.site.siteprivileges.filter(user=user):
+        user_site_roles.append(priv.role.role)
+
     blessed_service_classes = [ServiceClass.objects.get(name="Best Effort")]
 
     return {"id": 0,
@@ -68,6 +72,7 @@
             "current_user_login_base": user.site.login_base,
             "current_user_site_users": [auser.id for auser in site_users],
             "current_user_site_user_names": [auser.email for auser in site_users],
+            "current_user_can_create_slice": user.is_admin or ("pi" in user_site_roles) or ("admin" in user_site_roles),
             }
 
 class TenantList(APIView):
diff --git a/planetstack/core/xoslib/static/js/xosTenant.js b/planetstack/core/xoslib/static/js/xosTenant.js
index 268b8ca..cb816a8 100644
--- a/planetstack/core/xoslib/static/js/xosTenant.js
+++ b/planetstack/core/xoslib/static/js/xosTenant.js
@@ -170,6 +170,12 @@
 

 XOSTenantApp.addSlice = function() {

     var app=this;

+

+    if (!xos.tenant().current_user_can_create_slice) {

+        window.alert("You do not have sufficient rights to create a slice on your site");

+        return;

+    }

+

     model = new xos.slicesPlus.model({site: xos.tenant().current_user_site_id,

                                       name: xos.tenant().current_user_login_base + "_"});

     console.log(model);

diff --git a/planetstack/core/xoslib/templates/xosAdmin.html b/planetstack/core/xoslib/templates/xosAdmin.html
index 574684b..ca2969e 100644
--- a/planetstack/core/xoslib/templates/xosAdmin.html
+++ b/planetstack/core/xoslib/templates/xosAdmin.html
@@ -228,12 +228,13 @@
   </div>
 </script>
 
-<script type="text/template" id="xos-datatable-spinner-template-old">
+<script type="text/template" id="xos-datatable-spinner-template">
     <!-- arguments: value, id, collectionName, fieldName -->
-    <%= value %> <a href='#increase/<%= collectionName %>/<%= id %>/<%= fieldName %>'>more</a> <a href='#decrease/<%= collectionName %>/<%= id %>/<%= fieldName %>'>less</a>
+    <%= value %> <img style="cursor: pointer;" src="/static/img/plus_circle.png" onclick='<%= app.varName %>.adjustCollectionField("<%= collectionName %>", <%= id %>, "<%= fieldName %>", 1)'>
+                 <img style="cursor: pointer;" src="/static/img/minus_circle.png" onclick='<%= app.varName %>.adjustCollectionField("<%= collectionName %>", <%= id %>, "<%= fieldName %>", -1)'>
 </script>
 
-<script type="text/template" id="xos-datatable-spinner-template">
+<script type="text/template" id="xos-datatable-spinner-template-old">
     <!-- arguments: value, id, collectionName, fieldName -->
     <%= value %> <a href="javascript:undefined" onclick='<%= app.varName %>.adjustCollectionField("<%= collectionName %>", <%= id %>, "<%= fieldName %>", 1)'> more </a>
                  <a href="javascript:undefined" onclick='<%= app.varName %>.adjustCollectionField("<%= collectionName %>", <%= id %>, "<%= fieldName %>", -1)'> less </a>