Example #1
0
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from utils.permission import title, checkbox, radio

MAP = title(_("FTP service"),
            {"proftpd": checkbox(_("dashboard access"), "dashboard",
                                 _("FTP client"),
                                {"ftp_client": (title(_("Directory access scope"),
                                                      {"access":  radio(_("self only"), "self",
                                                                        _("group only"), "group",
                                                                        _("any directory"), "global")},
                                                      _("Directory access type"),
                                                      {"type": radio(_("read only"), "read",
                                                                     _("read&write"),
                                                                     {"write": checkbox(_("Can change folder permissions"), "access_change")}
                                                                     )}),
                                                )},
                                _("has access to statistics"),
                                {"statistics": radio(_("user's only"), "self",
                                                     _("group's only"), "group",
                                                     _("everybody"), "global")},
                                _("can control daemon"), "daemon",
                                _("can view log files"), "log",
                                _("can monitor service's status"), "status")}
)

#MAX_PERM = {"proftpd": {"ftp_client": {"access_change": "global"}, "statistics": "global", "daemon": "", "log": "", "status": ""}}
### Example ###
# user_perm = {"proftpd": {"ftp_client": ""}, "statistics": "global", "log": "", "status": ""}
Example #2
0
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from utils.permission import title, checkbox, radio


"""
It's mandatory to sort priviliges in the permission maps by their strength
"""


MAP = title(_("Administration"),
            {"accounts": checkbox(_("User management"),
                                  {"actions": (checkbox(_("can create"), "add",
                                                        _("can delete"), "delete",
                                                        _("can_edit"), "edit"),
                                               title(_("Application scope"),
                                                     {"mode": radio(_("Group members only"), "group",
                                                                    _("Everybody"), "global")})
                                              )
                                   
                                   })
            }
)
Example #3
0
from django.utils.translation import ugettext as _
from utils.permission import title, checkbox, radio

MAP = title(_("VmWare Management Console"),
            {"vmware": checkbox(_("can view VMware hosts"),
                                    {"hosts": radio(_("view only"), "view",
                                                    _("view and edit"), "edit")},
                                _("VMware VMs management"),
                                    {"vmlist": checkbox(
                                                    _("can view VM status"), "status",
                                                    _("can view VM information"), "info",
                                                    _("can start/stop/restart VMs"), "control")
                                    }
                                )
             }
)
Example #4
0
# -*- coding: utf-8 -*-

from django.utils.translation import ugettext as _
from django.utils.datastructures import SortedDict as S
from utils.permission import title, checkbox, radio

MAP = title(_("FTP service"),
            {"proftpd": checkbox(_("FTP client"),
                                {"ftp_client": (title(_("Directory access scope"),
                                                      {"access_scope":  radio(_("self only"), "self",
                                                                              _("group only"), "group",
                                                                              _("any directory"), "global")},
                                                      _("Directory access type"),
                                                      {"access_type": radio(_("read only"), "read",
                                                                            _("read&write"), "write")}),
                                                checkbox(_("Can change folder permissions"), "access_change"))},
                                _("has access to statistics"),
                                {"statistics": radio(_("users's only"), "self",
                                                     _("group's only"), "group",
                                                     _("everybody"), "global")},
                                _("can control daemon"), "daemon",
                                _("can view log files"), "log",
                                _("can monitor service's status"), "status")}
)