예제 #1
0
    def list(self):
        """ List the user accounts in the system"""
        user_list = UserMgr.get_list()
        log.debug(user_list)
        tpl.user_list = user_list

        return render('/account/list.mako')
예제 #2
0
    def list(self):
        """ List the user accounts in the system"""
        user_list = UserMgr.get_list()
        log.debug(user_list)
        tpl.user_list = user_list

        return render('/account/list.mako')
예제 #3
0
    def delete(self, user_name):
        """Remove a user from the system if this is an admin

        :param user_name: the user to remove from the system

        """
        user = UserMgr.get(user_name=user_name)
        meta.Session.delete(user)
        redirect(url(controller="accounts", action="list"))
예제 #4
0
    def delete(self, user_name):
        """Remove a user from the system if this is an admin

        :param user_name: the user to remove from the system

        """
        user = UserMgr.get(user_name=user_name)
        meta.Session.delete(user)
        redirect(url(controller="accounts", action="list"))
예제 #5
0
    def edit(self, user_name):
        """Load the edit ui for this user"""
        tpl.user = UserMgr.get(user_name=user_name)
        tpl.group_list = GroupMgr.get_list()

        tpl.form_errors = False
        for g in tpl.group_list:
            if g in tpl.user.groups:
                log.debug("IN GROUP")
            else:
                log.debug("NOT IN GROUP")

        self.json.success = True
        return render('/account/edit.mako')
예제 #6
0
    def edit(self, user_name):
        """Load the edit ui for this user"""
        tpl.user = UserMgr.get(user_name=user_name)
        tpl.group_list = GroupMgr.get_list()

        tpl.form_errors = False
        for g in tpl.group_list:
            if g in tpl.user.groups:
                log.debug("IN GROUP")
            else:
                log.debug("NOT IN GROUP")

        self.json.success = True
        return render('/account/edit.mako')
예제 #7
0
    def edit_error(self):
        """Authenticate the changes to the user account specified

        Currently the only changes to a user account are to assign permission
        groups to it.

        """
        user_groups = request.params.getall('groups')
        user_name = request.params['user_name']

        user = UserMgr.get(user_name=user_name)

        # we're admin so we're allowed to do this regardless of username
        user.groups = GroupMgr.get_list(user_groups)
        redirect(url(controller="accounts", action="list"))
예제 #8
0
    def edit_error(self):
        """Authenticate the changes to the user account specified

        Currently the only changes to a user account are to assign permission
        groups to it.

        """
        user_groups = request.params.getall('groups')
        user_name = request.params['user_name']

        user = UserMgr.get(user_name=user_name)

        # we're admin so we're allowed to do this regardless of username
        user.groups = GroupMgr.get_list(user_groups)
        redirect(url(controller="accounts", action="list"))