:py:mod:`pywebui.users` ======================= .. py:module:: pywebui.users Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pywebui.users.User pywebui.users.UserMethods .. py:class:: User User object. .. attribute:: account the account name of the user. :type: str .. attribute:: dir the default directory. :type: str .. attribute:: disabled the boolean value, means user is disabled or enabled. :type: bool .. attribute:: owner the name of the owner of the account. :type: str .. attribute:: pri the default base priority. :type: int .. attribute:: priv the names of the privileges the user holds. :type: list(str) .. attribute:: uic the user identification code (UIC). :type: list(int) .. attribute:: username the user name. :type: str .. py:class:: UserMethods Encapsulates methods for manage users. .. py:method:: get_users(self) -> List[User] Returns list of users. .. py:method:: get_user(self, username) -> User Returns user details. :param username: Username of requested user :type username: str .. py:method:: create_user(self, username: str, owner: str, password: str, uic: List[str], def_priv: List[str], device: str, directory: str, pwd_expired: bool, priv: List[str], account: str = None, flags: List[str] = None) -> User Creates user. :param def_priv: default privileges for the user. :param device: the name of the user's default device at login (30 alphanumeric characters maximum). :param directory: the default directory name (39 alphanumeric characters maximum). :param owner: the name of the owner of the account (31 characters maximum). :param password: passwords for login (8 alphanumeric characters minimum, length to 32 alphanumeric characters. The dollar sign ( $ ) and underscore ( _ ) are also permitted). :param priv: privileges the user is authorized to hold. :param uic: the user identification code (UIC) (it’s in octal, don't use digits 8 and 9 for UIC). :param username: the user name (12 symbols maximum - alphanumeric characters. The dollar sign ( $ ) and underscore ( _ ) are also permitted). :param account: the account name of the user (8 symbols maximum - alphanumeric characters and underscores). :keyword flags: login flags for the user. :keyword pwd_expired: primary password is pre-expired (false is not pre-expired or true is pre-expired). .. rubric:: Example :: connector.create_user( username="testuser", owner="testowner", password="asd123asd123", uic=("312", "77"), def_priv=["NETMBX","TMPMBX"], device="SYS$SYSDEVICE", directory=f"[{tmp_username}]", pwd_expired=False, priv=["NETMBX","TMPMBX"], flags=["DISUSER"], ) .. py:method:: edit_user(self, username: str, **fields) -> bool Change user attributes. User attributes available for changing listed in `create_user()` method. Pass corresponding attribute as keyword argument. :param username: Username of requested user :type username: str .. rubric:: Example >>> c = pywebui.Connector('http://11.12.132.21:8082') >>> c.login('testuser', 'testuser') >>> c.edit_user('user1', owner = "owner1") .. py:method:: delete_user(self, username) -> bool Deletes user. .. py:method:: duplicate_user(self, username, new_username, uic) -> bool Duplicates user `username` to user with name `new_username`. .. py:method:: disable_user(self, username) -> bool Disables user. .. py:method:: enable_user(self, username) -> bool Enabled user.