Commit 233f0374 authored by Antoine Millet's avatar Antoine Millet
Browse files

Added account management methods to the client handler.

parent 23981a6a
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
@@ -170,7 +170,43 @@ class ClientHandler(OnlineCCHandler):

    @pure
    @listed
    def account_setpassword(self, login, password, method='ssha'):
        '''
        Define a new password for specified user.
        '''
        self._server.conf.set_password(login, password, method)

    @pure
    @listed
    def account_create(self, login, password, role):
        '''
        Create a new account with specified login.
        '''
        self._server.conf.create_account(login, password, role)

    @pure
    @listed
    def account_addtag(self, login, tag):
        '''
        Add a tag to the account with specified login.
        '''
        self._server.conf.add_tag(login, tag)

    @pure
    @listed
    def account_removetag(self, login, tag):
        '''
        Remove a tag of the account with specified login.
        '''
        self._server.conf.remove_tag(login, tag)

    @pure
    @listed
    def account_delete(self, login):
        '''
        Delete the account with specified login.
        '''
        self._server.conf.remove_account(login)

class AuthenticationError(Exception):
    pass