pywebui.users
¶
Module Contents¶
Classes¶
User object. |
|
Encapsulates methods for manage users. |
- class pywebui.users.User¶
User object.
- account¶
the account name of the user.
- Type
str
- dir¶
the default directory.
- Type
str
- disabled¶
the boolean value, means user is disabled or enabled.
- Type
bool
- owner¶
the name of the owner of the account.
- Type
str
- pri¶
the default base priority.
- Type
int
- priv¶
the names of the privileges the user holds.
- Type
list(str)
- uic¶
the user identification code (UIC).
- Type
list(int)
- username¶
the user name.
- Type
str
- class pywebui.users.UserMethods¶
Encapsulates methods for manage users.
- get_user(self, username) User ¶
Returns user details.
- Parameters
username (str) – Username of requested user
- 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.
- Parameters
def_priv – default privileges for the user.
device – the name of the user’s default device at login (30 alphanumeric characters maximum).
directory – the default directory name (39 alphanumeric characters maximum).
owner – the name of the owner of the account (31 characters maximum).
password – passwords for login (8 alphanumeric characters minimum, length to 32 alphanumeric characters. The dollar sign ( $ ) and underscore ( _ ) are also permitted).
priv – privileges the user is authorized to hold.
uic – the user identification code (UIC) (it’s in octal, don’t use digits 8 and 9 for UIC).
username – the user name (12 symbols maximum - alphanumeric characters. The dollar sign ( $ ) and underscore ( _ ) are also permitted).
account – the account name of the user (8 symbols maximum - alphanumeric characters and underscores).
- Keyword Arguments
flags – login flags for the user.
pwd_expired – primary password is pre-expired (false is not pre-expired or true is pre-expired).
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"], )
- 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.
- Parameters
username (str) – Username of requested user
Example
>>> c = pywebui.Connector('http://11.12.132.21:8082') >>> c.login('testuser', 'testuser') >>> c.edit_user('user1', owner = "owner1")
- delete_user(self, username) bool ¶
Deletes user.
- duplicate_user(self, username, new_username, uic) bool ¶
Duplicates user username to user with name new_username.
- disable_user(self, username) bool ¶
Disables user.
- enable_user(self, username) bool ¶
Enabled user.