1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-26 10:03:50 +03:00

Some retouch on permissions delegation... seems nice right now :)

This commit is contained in:
Adolfo Gómez García 2015-03-05 19:10:46 +01:00
parent 2435f589b9
commit c1fd898d62
6 changed files with 18 additions and 3 deletions

View File

@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
class Cache(Handler):
authenticated = True
needs_staff = True
needs_admin = True
def get(self):
'''

View File

@ -1,6 +1,10 @@
gui.configuration = new BasicGuiElement("Clear cache")
gui.configuration.link = ->
"use strict"
if api.config.admin is false
return
api.templates.get "configuration", (tmpl) ->
api.configuration.overview ((data) ->
gui.doLog data

View File

@ -2,6 +2,9 @@ gui.gallery = new GuiElement(api.gallery, "imgal")
gui.gallery.link = ->
"use strict"
if api.config.admin is false
return
newEditImageFnc = (forEdit) ->
realFnc = (value, refreshFnc) ->
api.templates.get "new_image", (tmpl) ->

View File

@ -6,6 +6,10 @@
gui.clear_cache = new BasicGuiElement("Flush cache")
gui.clear_cache.link = ->
"use strict"
if api.config.admin is false
return
api.getJson "cache/flush",
success: ->
gui.launchModal gettext("Cache"), gettext("Cache has been flushed"),

View File

@ -37,7 +37,7 @@
<!-- Navigation bar -->
<div id="wrapper">
{% block menu %}{% include 'uds/admin/snippets/navbar.html' %}{% endblock %}
{% block menu %}{% include 'uds/admin/snippets/navbar.html' with admin=request.user.is_admin %}{% endblock %}
<!-- End of menu -->
<!-- Content -->
<div id="page-wrapper">
@ -151,7 +151,9 @@
{% js_template 'services_pool' %}
{% js_template 'configuration' %}
{% js_template 'gallery' %}
{% js_template 'permissions'}
{% js_template 'permissions' %}
{% js_template 'permissions_add' %}
<!-- utility pages -->
{% js_template 'request_failed' %}
<!-- specific pages -->

View File

@ -20,6 +20,7 @@
<li><a class="lnk-osmanagers" href="#"><i class="fa fa-gears"></i> Os Managers</a></li>
<li><a class="lnk-connectivity" href="#"><i class="fa fa-sitemap"></i> {% trans 'Connectivity' %}</a></li>
<li><a class="lnk-deployed_services" href=""><i class="fa fa-puzzle-piece"></i> {% trans 'Service Pools' %}</a></li>
{% if admin %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-caret-square-o-down"></i> Tools <b class="caret"></b></a>
<ul class="dropdown-menu">
@ -28,6 +29,7 @@
<li><a class="lnk-clear_cache" href="#">{% trans 'Flush cache' %}</a></li>
</ul>
</li>
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right navbar-user">