mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-19 10:04:05 +01:00
A new button is available into the domain actions list and let the current user see the defined administrators of each domain.
see #201
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ class DomainsTable(tables.Table):
|
||||
width="50px", align="center")
|
||||
enabled = tables.Column("enabled", label=gender("Enabled", "m"), width="50px",
|
||||
align="center")
|
||||
actions = tables.ActionColumn("actions", label=ugettext_noop("Actions"), width="50px",
|
||||
actions = tables.ActionColumn("actions", label=ugettext_noop("Actions"), width="70px",
|
||||
align="center", defvalue=domain_actions)
|
||||
|
||||
cols_order = ["name", "creation", "modified",
|
||||
|
||||
@@ -169,6 +169,15 @@ def domain_actions(user, domid):
|
||||
"img" : static_url("pics/alias.png"),
|
||||
"title" : _("View aliases of this domain")}
|
||||
]
|
||||
if user.has_perm('admin.view_domains'):
|
||||
actions += [
|
||||
{"name" : "viewadmins",
|
||||
"url" : reverse(admin.views.view_domain_admins, args=[domid]),
|
||||
"img" : static_url("pics/administrators.png"),
|
||||
"title" : _("View administrators of this domain"),
|
||||
"class" : "boxed",
|
||||
"rel" : "{handler:'iframe',size:{x:310,y:190}}"},
|
||||
]
|
||||
return render_actions(actions)
|
||||
|
||||
@register.simple_tag
|
||||
|
||||
@@ -37,6 +37,7 @@ urlpatterns = patterns(
|
||||
(r'^permissions/domainadmin/edit/(?P<da_id>\d+)/$', 'edit_domain_admin'),
|
||||
(r'^permissions/domainadmin/promote/$', 'domain_admin_promotion'),
|
||||
(r'^permissions/domainadmin/assign/(?P<da_id>\d+)/$', 'assign_domains_to_admin'),
|
||||
(r'^permissions/domainadmins/(?P<dom_id>\d+)/$', 'view_domain_admins'),
|
||||
(r'^permissions/searchaccount/$', 'search_account'),
|
||||
(r'^permissions/delete/$', 'delete_permissions'),
|
||||
)
|
||||
|
||||
@@ -625,6 +625,14 @@ def assign_domains_to_admin(request, da_id, tplname="admin/adminform.html"):
|
||||
ctx.update(form=form)
|
||||
return _render(request, tplname, ctx)
|
||||
|
||||
@login_required
|
||||
@permission_required("auth.view_permissions")
|
||||
def view_domain_admins(request, dom_id, tplname="admin/view_domain_admins.html"):
|
||||
domain = Domain.objects.get(pk=dom_id)
|
||||
return _render(request, tplname, {
|
||||
"domain" : domain
|
||||
})
|
||||
|
||||
@login_required
|
||||
@permission_required("auth.view_permissions")
|
||||
@check_domain_access
|
||||
|
||||
Reference in New Issue
Block a user